• Resolved hhgk

    (@hhgk)


    I really like your slider block. But there is one thing that causes problems: The five additional image sizes “xl” to “xxxxxl” that your plugin is creating.

    I’m using an image optimization plugin Imagify. There I can setup the largest size for images. With this images that are too large get downsized by this plugin. But unfortunately with your image sizes this plugin only accepts downsizing of more than 4000px.

    I have tried to onload your sizes:

    add_action( 'init', 'j0e_remove_large_image_sizes', 10000 );
    function j0e_remove_large_image_sizes() {
      remove_image_size( 'xl' );
      remove_image_size( 'xxl' );
      remove_image_size( 'xxxl' );
      remove_image_size( 'xxxxl' );
      remove_image_size( 'xxxxxl' );
    }

    But Imagify still thinks it has to be larger than your largest image size.

    Would it be possible to get a setting to deactivate these sizes?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Gutenberg Slider

    (@gutenbergslider)

    We think we figured the issue and will release a fix in the next update so your unregister code should work

    Plugin Contributor Gutenberg Slider

    (@gutenbergslider)

    @hhgk it seems that from wordpress 5.3 you would have to use the followng code:

    add_filter( 'intermediate_image_sizes', 'remove_default_img_sizes', 10, 1);
    
    function remove_default_img_sizes( $sizes ) {
      $targets = ['xl', 'xxl', 'xxxl', 'xxxxl'];
    
      foreach($sizes as $size_index=>$size) {
        if(in_array($size, $targets)) {
          unset($sizes[$size_index]);
        }
      }
    
      return $sizes;
    }
    Thread Starter hhgk

    (@hhgk)

    That seems to work. Thank you.

    simply use remove_image_size in “after_setup_theme” hook. I tested it with huge images and it works well:

    // remove gutenslider image sizes:
    remove_image_size( 'xxl' );
    remove_image_size( 'xxxl' );
    remove_image_size( 'xxxxl' );
    remove_image_size( 'xxxxxl' );
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Huge images sizes’ is closed to new replies.