![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
-
AuthorPosts
-
July 10, 2018 at 9:03 am #983535
Hi,
I noticed a strange behavior (since version 4.3 or 4.4).
In older version Enfold just used a unmodified image from the media library, but now seems to crops it to 845×321.
This wouldn’t be a problem, but it seems that this cropped image has a much bigger size than the original, and this is a problem for the google pagepeed rating (which rates me considerably down just because of this image):
original image with 123KB vs. cropped image with 225 kB.
Strange as well is, that if I click on the featured image actually the original is opening (not the cropped one), I noticed this problem just because of the optimizations hints on Google PageSpeed Insights.
Here is the blog post where I noticed this problem.
(General note: I do not use wordpress-plugins for image optimization, I always optimize them with gimp before I upload them.)
July 10, 2018 at 1:16 pm #983646Hey catchbudapest,
Thank you for using Enfold.
The theme sets the highest possible quality for the uploaded image. The filter is in the functions-enfold.php file but you can override it in your child theme.
/** * Sets the default image to 100% quality for more beautiful images when used in conjunction with img optimization plugins * * @since 4.3 * @added_by Kriesi */ function av_return_100(){ return 80; } add_filter('jpeg_quality', 'av_return_100'); add_filter('wp_editor_set_quality', 'av_return_100');
Default return value is 100.
Best regards,
IsmaelJuly 10, 2018 at 1:52 pm #983677Hi Ismael,
thank you for the quick reply!
I already do the jpg-compression in gimp, usally with jpg-quality 85, and I don’t want any further “modification/compression” done by Enfold.
Does this mean I have to set the return value to 85, as in the following?
/** * Sets the default image to 100% quality for more beautiful images when used in conjunction with img optimization plugins * * @since 4.3 * @added_by Kriesi */ function av_return_100(){ return 85; } add_filter('jpeg_quality', 'av_return_100'); add_filter('wp_editor_set_quality', 'av_return_100');
Is it also possible to disable a further image compression of the uploaded image completely (as it was before Enfold version 4.3), since the uploaded images are already optimized?
July 11, 2018 at 2:39 am #983954Hi,
The theme doesn’t compress the images. It just sets the quality to 100 which is why the compressed image or thumbnail has a larger file size than the source file. The default quality set by WordPress is 80.
Best regards,
IsmaelJuly 11, 2018 at 5:27 pm #984307Thanks Ismael,
problem solved!
(I added your piece of code in the functions.php of the child theme, as suggested).Thanks for the explanation and support!
July 12, 2018 at 3:35 am #984434Hi,
Awesome! Glad we could help!
Please take a moment to review our theme and show your support https://themeforest.net/downloads
Don’t forget to bookmark Enfold Documentation for future reference.Thank you for using Enfold :)
Best regards,
IsmaelNovember 14, 2020 at 1:26 pm #1260483This reply has been marked as private.November 16, 2020 at 5:25 am #1260634Hi,
@fecanimedia: Did you regenerate the thumbnails after adding the above snippet? Try to use the one of the following plugins to regenerate the images with the new default thumbnail quality.// https://wordpress.org/plugins/regenerate-thumbnails/
// https://wordpress.org/support/plugin/simple-image-sizes/If you need further assistance, please feel free to open a new thread. We will close this one for now.
Have a nice day.
Best regards,
Ismael -
AuthorPosts
- The topic ‘Enfold increases file size of the featured image’ is closed to new replies.