[Support request] Scaled medium and small images

Home Forums Support [Support request] Scaled medium and small images

Home Forums Support Scaled medium and small images

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #375470
    Mikko

    Hello!

    My medium images are set at 360×360 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

    #375755
    Mikko

    Hey, I think I found a lot of info on this!

    https://wordpress.stackexchange.com/questions/14305/caption-in-page-adding-unwanted-10px-to-width/120580#120580

    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.

    #375766
    Tom
    Lead Developer
    Lead Developer

    Ah yes, that’s correct. Glad you found the solution! 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.