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