• I have created a child theme of TwentyTen and set the large image size to 650px in Media Settings, which appears to work correctly. If I check the properties in Firefox the image is the correct width. However, the code generated for the img tag has width=640. This is causing large images to overlap the caption frame because WordPress adds 10px to the img width via css to the caption wrapper div and I can’t figure out where the 640 is being generated.

    <div id="attachment_30607" class="wp-caption alignleft" style="width: 650px">
    <img class="size-large wp-image-30607" width="640" height="425" alt="" src="https://www.xxx/wp-content/uploads/2014/06/xxx-650x432.jpg">
    <p class="wp-caption-text">Some text here</p>
    </div>

    When I insert an image into a post the Size Large option displays 640 x ???, but as I said it is actually 650. I did previously have the large image set to 640px, but should that not be overwritten?

    Any help would be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The images you uploaded when you had the setting at 650 will not be resized. Only images uploaded after you changed the setting to 640 will be that width.

    There are some plugins that will regenerate your thumbnails after you have changed the settings if you have too many to do manually. You can deactivate and delete them when you’re done resizing the images.

    Thread Starter mrkred

    (@mrkred)

    That was my initial thought, but the images are actually being uploaded at the correct width of 650px. But, the dimensions in Insert Media are still showing ‘Size Large – option 640 x ???’ and ‘width=640’ is also being placed in the html img tag, which is messing the wp-caption up.

    I can fix it with css, but this should work out of the box. It’s as if the 640 has been stored somewhere in mysql, but the only instances that I can find are the images in the posts table, which, as you refer to, were uploaded before the size change.

    I’m probably missing something simple here. It’s driving me mad. I can’t figure out why these settings are still in place.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wrong image size rendering in img tag’ is closed to new replies.