0

I'm getting crazy with product image format in the gallery. I have some images that are 1280x1920 px that magento reduces to 800x1200 px. The i set the view.xml file, i cleared the pub cached image folder, gave the command php bin/magento catalog:image:resize and php bin/magento cache:clean, but the image in the gallery is alway 400x700 px and has white borders in the fotorama stage. How can in fix it?

1 Answer 1

1

Go to below path:

Your_Theme/etc/view.xml

Add transparency to false.

<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
    <images module="Magento_Catalog">
        <image id="category_page_list" type="small_image">
            <width>240</width>
            <height>300</height>
            <transparency>false</transparency>
        </image>
    </images>
</media>

Clear Cache and check White frame should be removed.

5
  • it is ok also if the images are jpg and not png?
    – user48824
    Mar 29, 2018 at 13:23
  • What do you mean by your comment ?
    – anonymous
    Mar 29, 2018 at 13:25
  • Sorry i was thinking about the image alpha channel. That thing it made me crazy, i lost a morning of work trying to fix it
    – user48824
    Mar 29, 2018 at 13:28
  • If it answer helps you might giving me upvote and accept it to help others !! Good Luck !!
    – anonymous
    Mar 29, 2018 at 13:34
  • not working man.
    – user48824
    Mar 29, 2018 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.