Search code examples
wordpressimagedimensions

wordpress wrong featured image size


I'm having a problem where wordpress keeps resizing the featured image, on a single blog post.

Here is an example of the html it is spitting out for:

the_post_thumbnail('large');

<img width="1900" height="849" src="http://127.0.0.1/wp-content/uploads/2016/02/MyImage-1903x850.png" class="attachment-large size-large wp-post-image" alt="MyImage-1903x850" srcset="http://127.0.0.1/wp-content/uploads/2016/02/MyImage-600x268.png 600w, http://127.0.0.1/wp-content/uploads/2016/02/MyImage-1903x850.png 1903w" sizes="(max-width: 1900px) 100vw, 1900px">

As you can see the actual image dimensions are 1903x850. However, wordpress has decided to add a different width/height in the img tag of 1900x849

Ive tried using regen thumbnails and reuploading the image, but it's really strange cant seem to work out why this is happening.


Solution

  • The image is scaling down because there's a max-width set of "1900px" when the image is actually 1903px.