Archived topic
Scaled medium and small images
2 replies · Started by Mikko on August 29, 2017
Hello!
My medium images are set at 360x360 in WordPress settings. But for some reason, medium images are served scaled, a tiny bit smaller than they actually are.
In this article, Firefox's 'View Image Info' tells me this:
262px × 360px (scaled to 252px × 346px).
I checked a random site from GeneratePress's showcased sites, and found a very similar problem, a 300px × 169px image scaled to 290px × 163px.
https://www.perfectbee.com/beekeeping-articles/new-beekeepers-journal/treatments-varroa-mites/
So maybe it's not just me?
I also tested with a small image, and again the small image was scaled to a bit smaller size than it actually is. What's happening here?
Mikko
Hey, I think I found a lot of info on this!
Just a guess: you've fixed WordPress's extra caption padding problem at some point, with a code similar to this, and now the original problem has been fixed?
add_filter('shortcode_atts_caption', 'fixExtraCaptionPadding');
function fixExtraCaptionPadding($attrs)
{
if (!empty($attrs['width'])) {
$attrs['width'] -= 10;
}
return $attrs;
}
My problem got solved with += 10 instead of -=10.
Ah yes, that's correct. Glad you found the solution! :)