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
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.
- it is ok also if the images are jpg and not png?user48824– user488242018-03-29 13:23:54 +00:00Commented Mar 29, 2018 at 13:23
- What do you mean by your comment ?anonymous– anonymous2018-03-29 13:25:47 +00:00Commented 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 ituser48824– user488242018-03-29 13:28:07 +00:00Commented Mar 29, 2018 at 13:28
- If it answer helps you might giving me upvote and accept it to help others !! Good Luck !!anonymous– anonymous2018-03-29 13:34:51 +00:00Commented Mar 29, 2018 at 13:34
-