Thumbnail Optimization

Posted in: Newspaper
Post count: 13

Hey guys, tried looking for a simple solution but couldn’t find one.

I create some fancy images for my site, the featured images are optimized a lot, but it seems like wordpress doesn’t optimize the thumbnails as I get a bunch of stuff like this on PageSpeed:

Losslessly compressing http://evolvehype.com/…ploads/2015/03/ehlprodivision-100×65.jpg could save 249.5KiB (98% reduction).

What’s the easiest way so that the thumbnails are much smaller?

Thanks!

Post count: 1291

Hi,

Wordpress doesn’t compress images by default, you have to compress them yourself before upload, or use a plugin which can add such functionality, or add the following code in functions.php:

add_filter( 'jpeg_quality', create_function('', 'return 50;' ) );

This will compress all images to 50%, you can change that value, after you add the code you have to regenerate all thumbs – https://forum.tagdiv.com/how-to-fix-strange-thumbnails/

Thank you, Emil G.

Post count: 13

Thanks for the reply Emil,

I added the code then installed Regenerate Thumbnails, but it doesn’t look like it did anything. Same thing saying thumbnails aren’t optimized

Post count: 9544

Weird. Perhaps you have some caching turned on conflicting with that, and so serving up old version of image.

This image is pretty big

http://evolvehype.com/…ploads/2015/03/ehlprodivision-100×65.jpg

254 KB (260,690 bytes)

with a quality factor of “50” — and images re-generated
generally speaking the size would/should be roughly 3 KB

perhaps you have some aggressive caching turned on? YOu need to turn that OFF before running the regenerate-thumbnails …

also make sure your functions file has the RIGHT code to do that — check it against my optimization sticky at top of forum as my code from functions.php is also there.

It does work 🙂

  • This reply was modified 11 years by simchris.
Post count: 9544

You do need to have the GD Libraries or ImageMagick running on your server. But that is assumed otherwise you’d have no thumbnails at all.

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.