admin
18-04-2010, 06:24 PM
Code làm trang web để thu nhỏ kích thước ảnh với nhiều kích thước khác nhau
http://i43.tinypic.com/25iavmg.jpg
AnySize is a lightweight, drop-in, fully automated, caching, make-you-coffee-and-serve-it-in-bed script that lets you request and generate images (jpg, gif or png) of any size.
For example:
You upload “image.png” to your image folder, “images”
The image is returned at its native resolution
A thumbnail is presented
A medium sized image is presented
An image with max width 150px and max height 100px is presented. Aspect ratio is maintained.
An image with width 150px and height 100px is presented. Aspect ratio is NOT maintained.
And now for the awesome:
When you request an image the first time the result is stored in a cache folder and all further requests use that cache. Image file updated and re-uploaded? No need to flush the cache; everything is automatically taken care of!
Want to define the size of your “thumbnail” image? Want to add a “megaawesome” option so you can request images/image.png?s=megaawesome ? Want to disable arbitrary resizing (options 4 & 5)? No problem! Everything is set up in the first few lines of the code using intuitively-named variables. Works out of the box but is extremely easy to customize.
The following are flags and variables the system understands:
s: (Set Size)
Ex:
Returns an image of a pre-determined size (as set at the top of the anySize.php file)
The default sizes out of the box are:
s=thumb: max size 60×60 image.
s=small: max size 200×200 image.
s=medium: max size 400×400 image.
s=large: max size 800×800 image.
Note: These sizes are truly simple to change, add, remove, etc. Comments in the file show how to edit these sizes.
Included in the anySize download is a speed-optimized version of the script that uses just the size flag (s) and boosts the cache speed for truly lightweight and lightening fast operation.
http://megaupper.com/files/HUYDMRX8/anysizecachingimageresizer53074.rar
http://uploading.com/files/de1738c4/anysizecachingimageresizer53074.rar
http://i43.tinypic.com/25iavmg.jpg
AnySize is a lightweight, drop-in, fully automated, caching, make-you-coffee-and-serve-it-in-bed script that lets you request and generate images (jpg, gif or png) of any size.
For example:
You upload “image.png” to your image folder, “images”
The image is returned at its native resolution
A thumbnail is presented
A medium sized image is presented
An image with max width 150px and max height 100px is presented. Aspect ratio is maintained.
An image with width 150px and height 100px is presented. Aspect ratio is NOT maintained.
And now for the awesome:
When you request an image the first time the result is stored in a cache folder and all further requests use that cache. Image file updated and re-uploaded? No need to flush the cache; everything is automatically taken care of!
Want to define the size of your “thumbnail” image? Want to add a “megaawesome” option so you can request images/image.png?s=megaawesome ? Want to disable arbitrary resizing (options 4 & 5)? No problem! Everything is set up in the first few lines of the code using intuitively-named variables. Works out of the box but is extremely easy to customize.
The following are flags and variables the system understands:
s: (Set Size)
Ex:
Returns an image of a pre-determined size (as set at the top of the anySize.php file)
The default sizes out of the box are:
s=thumb: max size 60×60 image.
s=small: max size 200×200 image.
s=medium: max size 400×400 image.
s=large: max size 800×800 image.
Note: These sizes are truly simple to change, add, remove, etc. Comments in the file show how to edit these sizes.
Included in the anySize download is a speed-optimized version of the script that uses just the size flag (s) and boosts the cache speed for truly lightweight and lightening fast operation.
http://megaupper.com/files/HUYDMRX8/anysizecachingimageresizer53074.rar
http://uploading.com/files/de1738c4/anysizecachingimageresizer53074.rar