• Resolved aspsa

    (@aspsa)


    WordPress 5.5.1 seems to be generating an unanticipated number of responsive images. To test this WordPress capability, I imported a 5472×3648 image into the Media Library. I only have the default WordPress “Media Settings” image sizes set as follows:

    Thumbnail size: 150px by 150px (set to hard crop)
    Medium size: 300px by 300px (set to proportional resize, a.k.a., ‘soft crop’)
    Large size: 1024px by 1024 (set to proportional resize, a.k.a., ‘soft crop’)

    I commented out all the custom image sizes defined in my theme and their media resizing behaviors, although the latter is irrelevant for this issue.

    I expected WordPress to auto generate three additional images from the original image file with the following dimensions:

    150×150
    300×200
    1024×683

    Instead, WordPress also generated additional images with these dimensions:

    768×512
    1536×1024
    2048×1365

    …and one image whose file name was appended with “-scaled”. I checked its dimensions in another application and found it to be proportionally resized to the following dimensions:

    2560×1707

    I am at a lost as to why WordPress generates these additional image files. At first I thought WordPress may proportional scale the “Media Settings” image sizes both with a width bias and a height bias. However, the dimension values for these additional images to not bear out this assumption. Besides, if this were the case, I would have expected only two additional resized images to account for the height bias scaling of “Medium size” and “Large size” images.

    The web sites I work on generally contain a fairly large number of images. I want to retain the original high-resolution images on the sites’ servers but eliminate any extraneous resized images.

    Can someone explain why WordPress generates the extra additional images described earlier? Your feedback is greatly appreciated. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • the additional thumbnail sizes could be set by your theme

    WordPress 5.3 and later will auto resize large image to max 2560px. You can disable it by adding this in theme’s function.php:
    add_filter( 'big_image_size_threshold', '__return_false' );

    can anyone pl tell me how I can start a new thread on support forum?

    Thread Starter aspsa

    (@aspsa)

    Leiw, thank you for the reply. The WP 5.3 change explains the auto-generated “scaled” image. With respect to the additional auto-generated images, I created a WP theme from scratch and, for testing purposes, commented out all custom-sized image code in my functions.php file. The only auto-generated images in my theme should only relate to those defined in WP’s media settings and the WP 5.3+ auto-generated scaled image.

    Any thoughts as to why the additional images I noted in this thread are auto-generated by WP? Thank you.

    Thread Starter aspsa

    (@aspsa)

    After some additional research, I located the answer. As of WordPress 5.3, WordPress auto-generates seven different alternate image sizes, not including any additional custom image sizes defined by a WordPress theme. This excellent article by Jeff Starr provides very useful information on this topic and includes how to selectively disable auto-generating any or all of the default and custom images sizes (see How to Disable WordPress Automatically Generated Images – Complete Guide).

    • This reply was modified 4 years, 5 months ago by aspsa.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unexpected Auto-Generated Number of Responsive Images’ is closed to new replies.