• The image sizes that RT generates sometimes does not match the original image sizes generated by WP’s media library when image was uploaded

    In the linked post, it has an image tag referencing this image:
    http://www.williamstewart.me/wordpress/wp-content/uploads/2013/10/20131013-L2009596.jpg

    The IMG src and srcset images are looking for this image:
    http://www.williamstewart.me/wordpress/wp-content/uploads/2013/10/20131013-L2009596-620×442.jpg

    The 620 size was added by:
    add_image_size( ‘ws-large-620’, 620, 9999 );

    The size of the image generated by RT when I regenerated it with that image size set is:
    http://www.williamstewart.me/wordpress/wp-content/uploads/2013/10/20131013-L2009596-620×443.jpg

    I’ve seen this with quite a few images on my site, and have gone through and manually fixed them, but this is a problem for me – I have alot of images that still need to be fixed.

    Looking at the source image, it has dimensions of: 896×640. Scaling this down to a 620 width, gives:
    442.857142857142857

    So, it looks like the RT plugin is rounding up (which Photoshop does as well):
    int(442.857142857142857 + 0.5) gives 443

    Whereas the original WP upload generates a size by truncating:
    int(442.857142857142857) gives 442

    Because I can’t regenerate the HTML code (the srcset also has the “wrong” image size), so the image sizes that the plugin does generate has to be completely compatible with the pre-existing HTML parameters, which is a substantial problem..

    I’m guessing this is a known issue, and I agree that it is a better behaviour. But because I can’t regenerate the HTML now, it is a huge problem for me (I can’t “fix” the srcset sizes without being able to do that).

    Ideally, I would like to be able to regenerate the HTML along with the regeneration of the images.

    Thanks

    William

    • This topic was modified 7 years, 10 months ago by bst7.
    • This topic was modified 7 years, 10 months ago by bst7.
    • This topic was modified 7 years, 10 months ago by bst7.

    The page I need help with: [log in to see the link]

The topic ‘Incompatible – “wrong” – image size generated’ is closed to new replies.