I claim no expertise whatsoever here, but I will relate my experience with similar pursuits ....

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).


In reply to Re: Resizing Uploaded Images? by Hagbone
in thread Resizing Uploaded Images? by cirisme

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.