Support » Theme: Hamilton » Post editor not recognizing image sizes

  • Never experienced anything like this, and to be honest, I’m not even certain this is a theme issue. However, as themes sometimes have their own approach to image resizing I figured to post this here, in case..

    After checking Hamilton’s demo and seeing how the max image width was 1240px I rezised my media library using the *Force Regenerate Thumbnails* plugin. Set my *Large* size to 1240x9999px and *Thumbnail* to 610px wide (to match a 2–col gallery).

    However, when inserting (or editing) images in the post editor it doesn’t recognize the new *Large* size. The new *Thumbnail* is correct, but large shows up as 560px wide, a size that doesn’t even exist in my media library.

    Publishing the post with the *Large* image inserted shows a 560px image, off–center, but when I choose to View Image Info in the browser it tells me that the image is indeed 1240px wide (as it should be) but resized to 560px. Working on localhost so can’t provide a link but see here for screenshot.

    Any idea what might be causing this?

    All the best, Th

    • This topic was modified 3 years, 1 month ago by thorirv.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @thorviv,

    Hamilton sets its own image sizes for the featured images and images used for the post previews, so there’s no need to change the default WordPress sizes for Hamiltons sake. If they are changed, however, they will still adhere to the content width set by the theme when embedded using the media panel in the post/page editor. They will also be maxed out at the post content column width of the theme, unless they’re included in a gallery. That’s probably why the large images show up in a 560px resolution when they’re embedded.

    Try resetting the image sizes to the default values, and see if that fixes it.

    Thanks Anders for replying.

    My issue isn’t about featured images or post previews (which work very well!) but images in the post content.

    The reason I want to change my image size *Large* to match the width of the content is to display the size neccessary, and not have the browser down–scale an image that is larger. This to keep load times to a minimum and make for a better user experience.

    I understand why the images get scaled (by the browser) to the content width, but not why the WordPress post editor recognizes the *Large* image size as 560px when they are indeed larger (I’ve checked the image files in the media library and there aren’t any 560px images).

    I also see how the following css gives images not aligned a negative margin both left and right, but then the image needs to be wider than the post content, at least *content* plus *neg. margin left and right* (560px plus 2x80px), or 720px wide.

    .alignnone {
    	margin-left: -80px;
    	margin-right: -80px;
    	max-width: calc( 100% + 160px );
    }
    
    .alignnone img {
    	width: 100%;
    }

    The fact that it publishes an image that is too small (even when it isn’t) seems like a bug to me but I’m not enough css wizard to quickly spot what might be causing it.

    Feel free to have a look at the results I got from a fresh WordPress install with Hamilton installed, here (screenshot).

    Regards, Th

    Good theme! I am having the same problem with posting images to actual posts. Large images in HD are not loading to their accurate size when I add them in to the actual post – they are resized to thumbnails. I noticed on the Hamilton demo theme that the images are rendered to their true sizes, and even some are posted side by side as large thumbnail images. Please show me how to get that result for my posts. Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Post editor not recognizing image sizes’ is closed to new replies.