• Resolved yurchik1

    (@yurchik1)


    Greetings!

    I am a newbie to WordPress and am trying to understand how images work. I’ve found out that WordPress may generate lots of different sizes and load them each time it needs the specific one + requires more space. So I decided to remove any unused image sizes. For this, I found your plugin to see which sizes are currently being generated. It says:

    Thumbnail Sizes
    These are all of the thumbnail sizes that are currently registered:
    
    thumbnail: 150×150 pixels (cropped to fit)
    medium: 300×300 pixels (proportionally resized to fit inside dimensions)
    medium_large: 768×0 pixels (proportionally resized to fit inside dimensions)
    large: 1024×1024 pixels (proportionally resized to fit inside dimensions)
    1536x1536: 1536×1536 pixels (proportionally resized to fit inside dimensions)
    2048x2048: 2048×2048 pixels (proportionally resized to fit inside dimensions)
    woocommerce_thumbnail: 300×300 pixels (cropped to fit)
    woocommerce_single: 600×0 pixels (proportionally resized to fit inside dimensions)
    woocommerce_gallery_thumbnail: 100×100 pixels (cropped to fit)

    The question is, how can an image have 0 pixels? When I visit my uploads folder it doesn’t have that kind of images. The sizes are 768×576 and 600×450 (for zero dimensions). Please, could you help me identify, why does WordPress says so?

    Thank you for your time and efforts,

    Yuryi

    • This topic was modified 1 year, 2 months ago by yurchik1.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hello @yurchik1,

    The instances with the 0 pixels that you’re seeing means that the height of your image hasn’t been set, i.e ‘0’. This could be due to a configuration in your WooCommerce and/or WordPress settings where the image height has not been specified. In other words, WordPress (adn WooCommerce) automatically set the height in a way that preserves the aspect ratio of the image based on the width provided.

    You should be able to set that from your Dashboard > Settings > Media. In WooCommerce, it should be WooCommerce > Settings > Products > Display, but please note that it might be different depending on your theme and plugins if you have some that control picture sizes. In these cases, those settings might override WooCommerce and WordPress’s default settings.?

    After changing the image dimensions, remember to regenerate your thumbnails. Let me know how you get on!

    Thread Starter yurchik1

    (@yurchik1)

    Hello @erania-pinnera !

    Thank you so much for the reply! I’ve inspected settings in my Dashboard > Settings > Media and everything looks good:

    View post on imgur.com

    There is no such tab as WooCommerce > Settings > Products > Display, but I found it under Appearance > Customize > WooCommerce > Product Images. Although it says “Images” in plural, there is only one size and it is also set.

    View post on imgur.com

    The next popular thing I’ve seen on different forums no matter what the problem is, is to turn off all the plugins and switch to the default theme and see how it goes to ensure there’s no conflicts. That’s what I’ve done. I left only WooCommerce and Regenerate Thumbnails plugin, switched to the default Twenty Twenty-One theme and emptied cache. It still lists those:

    thumbnail: 150×150 pixels (cropped to fit)
    medium: 300×300 pixels (proportionally resized to fit inside dimensions)
    medium_large: 768×0 pixels (proportionally resized to fit inside dimensions)
    large: 1024×1024 pixels (proportionally resized to fit inside dimensions)
    1536x1536: 1536×1536 pixels (proportionally resized to fit inside dimensions)
    2048x2048: 2048×2048 pixels (proportionally resized to fit inside dimensions)
    post-thumbnail: 1568×9999 pixels (proportionally resized to fit inside dimensions)
    woocommerce_thumbnail: 450×450 pixels (cropped to fit)
    woocommerce_single: 600×0 pixels (proportionally resized to fit inside dimensions)
    woocommerce_gallery_thumbnail: 100×100 pixels (cropped to fit)

    I’ve also tried to turn off the WooCommerce plugin and I still have this:

    thumbnail: 150×150 pixels (cropped to fit)
    medium: 300×300 pixels (proportionally resized to fit inside dimensions)
    medium_large: 768×0 pixels (proportionally resized to fit inside dimensions)
    large: 1024×1024 pixels (proportionally resized to fit inside dimensions)
    1536x1536: 1536×1536 pixels (proportionally resized to fit inside dimensions)
    2048x2048: 2048×2048 pixels (proportionally resized to fit inside dimensions)
    post-thumbnail: 1568×9999 pixels (proportionally resized to fit inside dimensions)

    I would appreciate any other options in inspecting the issue further.

    Plugin Author Peter Kiss (a11n)

    (@yscik8)

    Hey Yuryi!

    The medium_large: 768×0 size is actually coming from WordPress itself, and not one of the plugins. It’s a default size, and the 0 means that this image is always 768px in width, with the height being automatic based on the image proportions. So for example, a 1200×800 image will be resized to 768×512, to keep the original aspect ratio.

    See this article for more details: Image Sizes in WordPress

    I wouldn’t worry too much about removing unused image sizes, storage these days is pretty cheap, and the pre-generated images make the site faster for visitors.

    Thread Starter yurchik1

    (@yurchik1)

    Hey, @yscik8 !

    Thank you so much for your answer, it helped me a lot! I don’t have any more questions now. I am still worried about the quantity of images because I am limited with it (+ speed from inodes), but thankfully to you, now I know how to handle that!

    Really appreciate your help,

    Yuryi

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @yurchik1,

    I will pass your kudos to our @yscik8 ??

    I’m going to mark this thread as solved. If you have any further questions or need more help, you’re welcome to open another thread here. Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Images with 0 dimension’ is closed to new replies.