WordPress.org

Ready to get started?Download WordPress

Forums

Shashin
Suboptimal image resizing problem (2 posts)

  1. mondalaci
    Member
    Posted 1 year ago #

    Hi Mike,

    I've just used Google PageSpeed Insights for my site which revealed numerous warnings like this:

    https://lh5.googleusercontent.com/-MvaubvtLHmM/UAySJWkLYbI/AAAAAAAAAEo/I2E_2LzTV44/IMG_0879.JPG?imgmax=640 is resized in HTML or CSS from 640x480 to 606x456. Serving a scaled image could save 4.9KiB (11% reduction).

    As it turns out in my posts Shashin codes like [shashin type="photo" id="31" size="large"] generated HTML like <img src="https://lh5.googleusercontent.com/-MvaubvtLHmM/UAySJWkLYbI/AAAAAAAAAEo/I2E_2LzTV44/IMG_0879.JPG?imgmax=640" alt="Wifi switchover fail" width="600" height="450" class="shashinThumbnailImage" id="shashinThumbnailImage_1" />

    I could easily notice that these images could be resized on the server side by providing the relevant imgmax parameter like https://lh5.googleusercontent.com/-MvaubvtLHmM/UAySJWkLYbI/AAAAAAAAAEo/I2E_2LzTV44/IMG_0879.JPG?imgmax=600

    This would conserve bandwith as much as possible.

    Is there any reason why Shashin doesn't use the best value for this parameter in such cases?

    Thanks,
    Laci

    http://wordpress.org/extend/plugins/shashin/

  2. Mike Toppa
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for pointing this out. When I wrote the code for handling sizing, Picasa only allowed you to request photos from a limited set of sizes. For example, 600 was not a valid option - you had to choose either 576 or 640. Now it looks like you can get any size you want from Picasa. When I added support for Twitpic and Youtube, I wanted to provide a consistent user experience with the sizes (as Twitpic also had a limited set of sizes, which were different from Picasa's). So Shashin picks the next largest valid size from whatever size you specify, and then relies on browser scaling.

    I've added this to the issues list: https://github.com/toppa/Shashin/issues/37

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.