in reply to Resizing Uploaded Images?
If you are interested in resizing images for display in a web page (and after they are uploaded), my experience has been .....
You can use "dumbnails" to resize without actually "touching" the original image. By calling the image via HTML, and using proportional width="whatever" and height="whatever" values, you can reduce the size visually of the image (using the Image::Size module), but you don't change a damn thing regarding the original (possibly bloated) uploaded image. The downside to this approach is that every time someone loads a page with one of these "dumbnails", the server has to handle to entire, possibly bloated, image.
I've also used ImageMagick to resize into true thumbnail's (and reduce the weight) of images on-the-fly, but the problem I've encountered has to do with the need to create temporary images to enable this method. The wall I hit was that you can create an image on the fly without creating a temporary image, but you can't include HTML with the output, cause of the need to call two different "Content-type:......" headers. Creating temp images works, but geez, it means a lot of create and destroy type programming that seems kind of counter productive to my feeble mind.
So ... I've got one area where I use dumbnails .... and I'll probably leave it like that, 'cause the situation involves only one image at a time, and I have image weight constraints installed in the upload programming so I can prevent "server-busting" images from being uploaded. I also have added a link below the dumbnail that points to the "view full size image". The good news is that once the dumbnail loads, viewing the full size image is damn near immediate 'cause most browsers keep the image in cache.
I've got another area where I'm displaying a dozen or more thumbnails, and in this area, I use the "create-a-temp-and-then-destroy" method.
I doubt this really offers any answers or insight, but I've posted the above in the hopes that it might help you, and also in the hopes that it might help me when some much-smarter-person replies with a comment that points out the stupidity in the way I'm handling image manipulation (and hopefully includes a neat and tidy solution to the issues I've brought up).
|
|---|