Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1488784

    Hi

    I’m just trying to convince our customer to upload smaller files sizes and use image compression and nexgen image formats etc rather than what they uplaod. However I’ve noticed that files that they have already uploaded which are for example 2500px wide x 1660px with a file size of 231KB. Enfold/Wordpress then creates files for banners etc which are 3 times the files size. e.g. 1500px x 630px becomes 721kb and 1500px x 430px becomes 670kb and so on.

    Do you know why this would be and how we can prevent the image files becoming larger than the orgiinal that is uploaded?

    Many Thanks
    Regards
    Colin

    #1488786

    Hey waveseven,
    This is due to the default image compression settings, Enfold unpacks the original file and generates new thumbnail sizes without applying compression, resulting in larger file sizes, especially for larger dimensions like “featured”, “featured_large”, and “extra_large”. This occurs because the theme sets the default JPEG quality to 100, which is higher than the typical WordPress default of 80, and the generated files are not compressed during the resizing process.
    To change the compression of new thumbnail sizes, add this code to the end of your child theme functions.php file in Appearance ▸ Editor and adjust to suit.

    add_filter("avf_jpeg_quality", "avf_set_quality_mod", 9999, 1); 
    add_filter("avf_wp_editor_set_quality", "avf_set_quality_mod", 9999, 1); 
    function avf_set_quality_mod($quality) { $quality = 60; return $quality;}

    For thumbnails already created you will need to regenerate the thumbnails

    Best regards,
    Mike

    #1488795

    Hi Mike

    Ah. that makes sense. Thanks for the code I’ll try that.

    Regards
    Colin

    #1488859

    Is there a similar code for webp files as well, as it also seems to increase the sizes of the additional images?

    Regards
    Colin

    #1488958

    Hi,
    Thanks for your patience, the theme does not have a built-in setting to directly control the quality or compression of WebP images during the generation process, the avf_jpeg_quality filter is designed for JPEG images and does not apply to WebP. Typically is handled by WordPress and the PHP image extension on your server, ie: ImageMagick or GD, which is more common. If you can switch to ImageMagick on your server you can follow this documentation to adjust it.
    Otherwise, I recommend using a plugin to compress WebP files further such as Imagify or WebP Express. I have not tested these, there may be others.

    Best regards,
    Mike

    #1488980

    Hi Mike

    No problem, thanks for your help. I will re add a compression plug-in. We initially remove it as the client didnt like the time it took to compress but I think he will just have to live with it.

    Regards
    Colin

    #1488982

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Enfold creating images larger than the orginal’ is closed to new replies.