attachment display settings show incorrect sizes

  • Unknown's avatar

    I am adding an image to my post. I am using the following image sizes (verified by looking at the files and regenerate image reports and media sizes):
    Thumb: 150×150 (cropped)
    Medium: 375×375 (preserve original ratio)
    Medium-Large: 768×0 (preserve original ratio)
    Large: 1024×1024 (preserve original ratio)

    When I add an image to the post, I see the following choices in the attachment display settings:
    Full Size (1900×1267)
    Large (525×350)
    Medium (375×250)
    Thumbnail (150×150)

    I don’t understand why I am not seeing the right size for “Large”. This is the HTML generated if I add an image of size Large

    I’ve no idea where it is getting the 525 size from, as I don’t have that size anywhere on my site that I’m aware of. I’d like the “Large” size to show the correct size (in this case 1024×683).

    The problem is also that if I use this size, the image does not display across the entire width of the post (which is about 640px I think). Twentyseventeen theme and WP 5.7.2

    Thanks

    William

  • Unknown's avatar

    Just to be clear, this is the img tag that gets created:

    img data-id=”6947″ src=”https://www.williamstewart.me/wordpress/wp-content/uploads/2020/04/20150830-L1004362-1024×683.jpg” alt=”” width=”525″ height=”350″ class=”size-large wp-image-6947″

  • Unknown's avatar

    Ok – so I figured out the obvious! The “Large” size is coming from a global in functions.php:
    $GLOBALS[‘content_width’] = 525;

    But the content_width of my posts is actually 640.

    It seems to me this should be a preference that can be explicitly set and then filters through to one of the image sizes that is being offered in the media library. I’d suggest TWO changes:
    “Large” should refer to the actual Large size of the image (not the content_width)
    A new image size: “Theme Content Width”, which reflects the content_width currently in use and this can be a user set preference (just as thumbnail, medium and large image sizes are).

    It seems a bit of a mess to me at the moment.

  • The topic ‘attachment display settings show incorrect sizes’ is closed to new replies.