Skip to content

View.xml is inheriting image sizes from parent (so an optional field is replaced by the value of parent) #12250

@quisse

Description

@quisse

I want to resize my images to a width of 250px and keep the aspect ratio (so I'm not adding a height tag). Instead of resizing the image to the full height of the image, Magento takes the height for that image from the parent theme's view.xml. So "If your theme does not contain a view.xml configuration file, it will be inherited from the parent theme. If you add the <theme_dir>/etc/view.xml file in your theme, it overrides the parent’s file." is a lie?

Preconditions

  1. Magento 2.1.9
  2. PHP 7.0.25

Steps to reproduce

  1. Copy view.xml from a parent theme and add it to new theme
  2. Remove <height> tag from image
  3. Resize images
            <image id="product_page_image_small" type="thumbnail">
                <width>250</width>
                <aspect_ratio>true</aspect_ratio>
                <frame>false</frame>
            </image>

Expected result

  1. An image with 250px width which kept the aspect ratio without adding

Actual result

  1. An image with 250px width and 90px height (as defined in the parent view.xml)
  2. image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.1.xThe issue has been fixed in 2.1 release lineFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions