Magento – Magento 2.3.0 product image cache resizing images to look very bad

image resizingmagento2magento2.3product-images

i have uploaded images to magento 2.3 and when i look on product page i can see it been resizing to different size with white lines.
look at original image that has been uploaded: https://babybeddingdesign.r.worldssl.net/pub/media/catalog/product/d/u/dumbo_bedding_set.jpg

the one seen on my site: https://babybeddingdesign.r.worldssl.net/pub/media/catalog/product/cache/9d08971813a040f8f96067a40f75c615/d/u/dumbo_bedding_set.jpg

link to the item: https://babybeddingdesign.com/dumbo-crib-bedding-collection-crib-bedding-set

all my products also old ones have been resizing. what is the problem with Magento 2.3?

Best Answer

In etc/view.xml of your current theme, you can update product image size

Make sure you resize with the expect ratio.

Use additional tag <frame> to prevent white borders on image. Use this code as example:

<image id="product_page_main_image" type="small_image">
    <width>460</width>
    <height>460</height>
    <aspect_ratio>true</aspect_ratio>
    <frame>false</frame>
</image>

Check all other tags, not just a tag with the id product_page_main_image check others too.

<frame>false</frame> was an issue in previous versions, it was not working in old 2.x versions and reported earlier

Note: If you still getting white border issue, then you need to use the below fix until it's offically released:

After creating a plugin to convert the string value to an integer (which properly casts to a boolean), the image frame is not added. For details see this

public function beforeSetKeepFrame($image, $keep)
{
    if (is_string($keep)) {
        $keep = (strtolower($keep) === 'true') ? 1 : 0;
    }
    return [$keep];
}
Related Topic