views:

46

answers:

3

My website allows uploading of images. I limit images to 10 megapixel or less JPEG images, all images get stored in a directory. Now I want the images resized on the fly and I am looking for a PHP class/library that can do that for me. While I can write (and I have written) gd-library code for resizing images I want something that's stable tested and more importantly provides some kind of caching. I intend to use the script like this:

http://www.website.name/some-script.php?image=HPIM0001.jpg&max-size=600x450

Any suggestions (do mention pros/cons).

+3  A: 

There's WideImage, which is pretty good. Caching is AFAIK not built in, but that should be trivial to put on top...

if (!file_exists($filename . '_thumb.jpg')) {
    // Load original, resize, save to $filename_thumb.jpg
}

// serve $filename_thumb.jpg
deceze
+1  A: 

http://shiftingpixel.com/2008/03/03/smart-image-resizer/

Includes caching, probably will do what you're looking for.

Erik
good example, very obscured
Salman A
+2  A: 

Try phpThumb. Thanks.

Chetan sharma