Hi,
In a page I have a Perfect Grid Masonry that display 12 images. Each of these image, in the Media Library, is approximately 50 KB (for 800×500 pixels) but that masonry load many of these images resing at a different dimension (705×470).
The result is that the “resized” image are also 5 more time heavy: from 50KB until 250 KB and so the page, that should be totally 500KB, is indeed more that 2.5MB.
How can I resolve?
Best Regards
Giovanni
Hey psipar,
Thank you for using Enfold.
That is the default size used by the masonry element. The maximum width and height are set to 705px.
It’s quite odd that the generated thumbnails are bigger or heavier than the original images. Do you mind if we take a look at the page with the masonry element? We would like to inspect the images.
Best regards,
Ismael
Hi,
That’s odd. Please try to decrease the default image quality. The theme sets it to 100 instead of the WP default value of 80.
function av_return_100(){ return 80; }
add_filter('jpeg_quality', 'av_return_100');
add_filter('wp_editor_set_quality', 'av_return_100');
You have to regenerate or upload the images again.
// https://wordpress.org/plugins/regenerate-thumbnails/
Best regards,
Ismael
Hi,
with that code I resolved.
But I think it’s a good idea if I could specify the image compression level directly on theme option. And it’s strange that the theme force a default value of 100.
thanks,
best regards
Giovanni