Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1467349

    Hi
    is it normal for the theme to create 14 duplicates of a single image upload, some x5 heavier than the original although not larger in dimensions than the original?
    I’ve uploaded a single 1000px 63 kb image file and got 14 versions. Are all these duplicates needed?
    How do I get the theme to stop this?
    How do I know which image sizes variations are needed for the content to display properly ?

    see duplicates
    image-duplicates-enfold“>

    • This topic was modified 2 months ago by Yory.
    #1467358

    in which cases image duplicates of 330kb are served instead of the 60kb original?

    #1467434

    Hi,

    Thank you for the inquiry.

    It’s normal for WordPress and themes to generate different sizes or thumbnails for images. This helps avoid using the original or larger image when it’s not necessary. Each thumbnail is used based on the element or template where it needs to be displayed. If you want to prevent the theme from generating these thumbnails, you can add the following filter to your functions.php file:

    // Disable loads of Enfold & WP image sizes upon upload
    add_action('init', 'remove_enfold_image_sizes');
    function remove_enfold_image_sizes() {
    // do NOT remove widget size, is used in backend portfolio items!
    // remove_image_size('widget');
      remove_image_size('square');
      remove_image_size('featured');
      remove_image_size('featured_large');
      remove_image_size('portfolio');
      remove_image_size('portfolio_small');
      remove_image_size('gallery');
      remove_image_size('magazine');
      remove_image_size('masonry');
      remove_image_size('entry_without_sidebar');
      remove_image_size('entry_with_sidebar');
      remove_image_size('shop_thumbnail');
      remove_image_size('shop_catalog');
      remove_image_size('shop_single'); 
      remove_image_size('shop_gallery_thumbnail');
    }

    Related thread: https://kriesi.at/support/topic/media-upload-and-enfolds-thumbnail-sizes/

    Best regards,
    Ismael

    #1467471

    Thanks
    I have about 120 images in the media library of about 65 kb each. Should be about 8MB total. But my content>uploads directory is now over 600MB. If I use the filter code to prevent further duplication of images, how can I tell which duplicates should not be removed as they are needed to properly serve content to all devices?

    Is this good practice for the theme to create duplicates of an original image of 1000px x 750px at 65kb duplicated to 845px x 684px at 330kb? When is it considered good practice to serve 330kb images?

    I will also need to remove the duplicates from the server to clear space. I see this option is available only at the premium versions of some plugins. Is there a way to remove the duplicates, their meta and db entries?

    #1467491

    Hi,

    Thank you for the update.

    how can I tell which duplicates should not be removed as they are needed to properly serve content to all devices?

    WordPress or the theme will automatically fallback to the original image when the required thumbnail is not available. As mentioned above, all those thumbnails are used for different elements or templates in the theme.

    Is this good practice for the theme to create duplicates of an original image

    The duplication or thumbnail generation process is not done by the theme, but by WordPress itself. If you need to decrease the overall size and quality of the image, you can use this filter in the functions.php file:

    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 = 55; return $quality;}
    

    This filter will set the compression quality from 100% to 55%.

    I will also need to remove the duplicates from the server to clear space. I see this option is available only at the premium versions of some plugins.

    You may need to manually delete the images and re-upload them again if you want to also clear the related database entries.

    Best regards,
    Ismael

    #1467569

    Thank you
    So regardless of the theme WP will create 14 duplicates all at 100% quality which may inflate the original file size although file dimensions are smaller?

    I applied the filters and they do prevent most of the duplicates and control their quality hence file size. The duplicates now are:
    300×225
    80×80
    768×576 (is this a widget?)
    36×36

    I am still not clear if the absence of this duplicates will create problems in serving the content to different devices.

    #1467615

    Hi,
    I recommend leaving these last 4 sizes, they are needed.
    Removing them will force smaller devices to show the larger images, WordPress automatically shows the correct images.
    If you use Ismael’s filter these images will not take a lot of space.

    Best regards,
    Mike

    #1467626

    Thanks
    I noticed that I had issues with posts featured image on post silder. Seems like it needs to be a specific size in order to be display properly on the slider. Which size is that?

    #1467628

    Hi,

    I noticed that I had issues with posts featured image on post silder

    It should automatically fallback to the original image when the required thumbnail is not available. Where can we see the issue?

    Best regards,
    Ismael

    #1467681

    I was trying to figure out which of the image files created is used as featured image by the posts slider and other elements displaying a featured image. I commented out the 845×684 in the filter but it still is displaying an image with inconsistent aspect ratio I think as a featured image in the:
    posts slider (bottom of page here) https://bitly.cx/bpfGm
    category pages https://bitly.cx/vSNm3
    blog post page https://bitly.cx/D8QU
    tag pages https://bitly.cx/UFSc
    I see the post slider has a Preview Image Size option but was unsuccessful using it so far.
    Your input is appreciated on this as I would like to filter out and remove 845×684 images if they are not solving this, and set the site to automatically create/crop the original image so all the above mentioned pages/modules display uniform featured image size / aspect ratio . Is that possible?
    Thanks

    #1467703

    Hi,

    Thank you for the info.

    Try to remove this line in the remove_enfold_image_sizes function above.

    remove_image_size('portfolio');
    

    The post slider or the blog grid layout uses the “portfolio” thumbnail by default.

    Best regards,
    Ismael

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.