2

I have installed magento 2.3 version, and I'm not able to remove frame from fotoroma image.

I have tried to override/extend view.xml from parent theme and tried options like <frame>false</frame>, but that also didn't work.

Here is my extended view.xml:

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<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="product_page_image_large" type="image" />
            <image id="product_page_image_medium" type="image">
                <width>518</width>
                <height>712</height>
                <frame>false</frame>
            </image>
            <image id="gift_messages_checkout_small_image" type="small_image">
                <width>368</width>
                <height>275</height>
            </image> 
            <image id="mini_cart_product_thumbnail" type="thumbnail">
                <width>368</width>
                <height>275</height>
            </image>
            <image id="product_thumbnail_image" type="thumbnail">
                <width>368</width>
                <height>275</height>
            </image>
            <image id="rss_thumbnail" type="thumbnail">
                <width>368</width>
                <height>275</height>
            </image>
            <image id="sendfriend_small_image" type="small_image">
                <width>368</width>
                <height>275</height>
            </image>
        </images>
    </media>
</view>
3
  • Update the code of view.xml file into question. Dec 25, 2018 at 12:59
  • @DhirenVasoya Updated my question, Please check. Jan 2, 2019 at 9:16
  • @Gopal Garva, add screenshot please
    – fmsthird
    Jan 2, 2019 at 9:19

2 Answers 2

1

try to add

<frame>false</frame>

into product_thumbnail_image like this

<image id="product_thumbnail_image" type="thumbnail">
                <width>368</width>
                <height>275</height>
                <frame>false</frame>
            </image>

Run caching, deploy command and check.

1
  • this does not solve the problem. In my case the white frame is still there (after having flushed image cache of course). the only way I found to remove white frame is to put 0 instead of false in the view.xml. Is there any better way to handle also the false value in view.xml?
    – giani.sim
    Jan 18, 2019 at 11:25
1

My guess is the frame parameter in view.xml as mentionned in Dhiren answer is not meant for this. Its documentation states :

If set to true, images are not cropped. Default value: true. Applied only if aspect_ratio is set to true.

cf: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-images.html#view_xml_structure

What I found out was just set a max-height to div fotorama__stage with what you set up in view.xml solves it :

For instance if view.xml is setup like this :

<image id="product_page_image_medium" type="image">
  <width>518</width>
  <height>712</height>
  <frame>false</frame>
</image>

Setting a max-height for fotorama__stage to the same height set up in view.xml did the trick :

.fotorama__stage {
    max-height:712px;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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