• Resolved ronr1999

    (@ronr1999)


    You mention that you add 768 height to medium_large. It appears that this is preventing the removal of that size (with code). We will never use 768×768. How do we disable this in your plugin?

    BTW… excellent job. This is the best image “handler” we’ve used… love it!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor hemenderki

    (@hemenderki)

    Hello @ronr1999!

    Thank you so much for your kind words and for the review.

    May I ask why you want to remove the 768 size?

    The reason I as is because this size is one of the most important sizes and the one most often used for mobile phones. WordPress uses this size automatically via the srcset tag. If you remove this size WP will be forced to choose a larger sized image and it will give you worse loading time and worse rating on page speed test like Google PageSpeed Insights and GTmetrix.

    Let me know if my comment doesn’t make sense.

    Thread Starter ronr1999

    (@ronr1999)

    Thanks for the quick reply. This really relates to our extensive use of Elementor and its new Container layout. And, the information found in this YouTube and this Grid Layout.

    I want to size my images to fit that flex 1120px grid with 20px gutter. Those images sizes then become: 265px, 360px, 550px, 1120px. Having 768px does not fit that layout and just adds another file to the server. ( still haven’t found a way to remove the medium_large size ).

    I’m thrilled to have found your plugin. Except for the 768 issue, it’s perfect!

    Plugin Contributor hemenderki

    (@hemenderki)

    I see.

    I just want to make sure that you understand that those image sizes also needs to be retina resolution, meaning 2x and 3x the size. So for example the 360px image size will not be used in the 360px container when the website is viewed on an Ipad. Tablet computers usually have 2x or 3x the pixel density. Meaning you will need a 720px image and a 1080px image for that container.

    Therefore pixel perfect images sizes are almost impossible to account for. Instead the idea behind responsive images is that you provide the browser with the some sizes in some sort of pattern and then let the browser pick the appropriate image for every screen and device.

    Could you please confirm if you already know all of this. If so, and you still want to remove the 768px, I will see what we can do to solve your problem. ??

    Thread Starter ronr1999

    (@ronr1999)

    We turn off srcset. OUR TEST PAGE

    We do not want the browser to use images that could be twice or three times in file size. And with your plugin providing optimal compression and sharpness… we’re happy. I hate to ask to change your plugin’s code for 768. We did find a way to disable it with:

    
    // REMOVE MEDIUM_LARGE FILE SIZE
    add_filter( 'intermediate_image_sizes', function( $sizes ) {
        return array_filter( $sizes, function( $val ) {
            return 'medium_large' !== $val; // Filter out 'medium_large'
        });
    });
    
    Plugin Contributor hemenderki

    (@hemenderki)

    Oh great! I glad you found a solution. ??

    Let me know if there’s anything else we can assist you with.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove medium_large image size?’ is closed to new replies.