Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.)

    #983646

    Hey 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,
    Ismael

    #983677

    Hi 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?

    #983954

    Hi,

    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,
    Ismael

    #984307

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

    #984434

    Hi,

    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,
    Ismael

    #1260483
    This reply has been marked as private.
    #1260634

    Hi,


    @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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Enfold increases file size of the featured image’ is closed to new replies.