Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1131862

    When I upload a single image, up to 18 different formats of this same image are saved on the server. It is causing problems with the available space on my domain. Is it possible to switch this off or to reduce this number? I am only using 1 format, so why all these different sizes? Thank you!

    #1131904

    all things goes to your child-theme functions.php:

    this is how you can avoid responsive Image functionality in WP:

    add_filter('wp_get_attachment_image_attributes', function($attr) {
       if (isset($attr['sizes'])) unset($attr['sizes']);
       if (isset($attr['srcset'])) unset($attr['srcset']);
       return $attr;
    }, PHP_INT_MAX);
    add_filter('wp_calculate_image_sizes', '__return_false', PHP_INT_MAX);
    add_filter('wp_calculate_image_srcset', '__return_false', PHP_INT_MAX);
    remove_filter('the_content', 'wp_make_content_images_responsive');

    this is too WP related:

    
    // Remove unneeded WP image sizes
    add_filter( 'intermediate_image_sizes_advanced', 'prefix_remove_default_images' );
    // Remove default image sizes here. 
    function prefix_remove_default_images( $sizes ) {
    // do NOT remove small and medium sizes, they are used in backend Media Library!
    // unset( $sizes['small']); // 150px
    // unset( $sizes['medium']); // 300px
     unset( $sizes['large']); // 1024px
     unset( $sizes['medium_large']); // 768px
     return $sizes;
    }

    And this is for Enfold Functionality: Choose the needed Image Formats yourself:
    some are commented-out feel free to get rid of them too – allthough the reason for usage is described:

    // Disable loads of Enfold & WP image sizes upon upload
    // do image sizes manually, double-size with high compression for retina screens
    // use Photoshop to set exact double size and quality between Q30 and Q40
    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');
    }
    #1131905

    If you have allready a lot of images uploaded – there are (temporary) Plugin like Force Regenerate Thumbnails after you have done all that above.

    in Addition to that i do have another entry for child-theme functions.php:

    function av_return_100(){ return 65; }
    add_filter('jpeg_quality', 'av_return_100');
    add_filter('wp_editor_set_quality', 'av_return_100'); 

    the uploaded images are decompressed – cropped – and then saved as uncompressed files on default – this code does induce that a compression is done.
    If you look to your uploads folder – you will see that some of the 1500px x 630px images – Enfold generates – are bigger (sometimes much bigger) than the orignal image uploades ( with 2000px and more)

    #1132033

    Hi Straver-reclame,

    Have you tried the solution posted above?


    @Guenni007
    Thank you for your input.

    Best regards,
    Victoria

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