Why send an 80kb 400x400 image scaled to 40x40 with IMG attributes when a real 40x40 one would be 4kb?

One possible reason is if the 400x400 image is expected to be viewed later. Why send 4kb 100 times and then 80kb 95 times when sending 80kb 100 times will do? In your example, this justification would only work if the larger image were requested about 95% of the time (though that would still win with protocol overhead) but, with different images, that ratio could be a lot lower. There is no substitute for traffic analysis.

Another reason might be because generating thumbnails on the fly is expensive in terms of both CPU and time. You might argue that one should then generate the smaller images ahead of time but that approach could be costly in terms of disk and, perhaps more importantly, maintenance issues. These problems could be compounded by the need for multiple thumbs of different sizes.

Having many ways to do things is so desirable because which of those ways is best usually depends on the problem at hand.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re^2: Manipulating Images (height and width) by sauoq
in thread Manipulating Images (height and width) by Anonymous Monk

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.