Skip to content

Image brackground  #8799

Closed
Closed
@delyriand

Description

@delyriand

Preconditions

  1. Magento 2.1.3
  2. PHP 7

Steps to reproduce

  1. Edit view.xml file
    ex: theme-frontend-luma/etc/view.xml
  2. Add background color attribute to an image
<image id="related_products_list" type="small_image">
     <width>152</width>
     <height>230</height>
     <background>[250,247,247]</background>
</image>
  1. Clear cache and reload images.

Expected result

  1. Image with background

Actual result

  1. Product image always has a black background
    image

The problem comes from 2 methods:

  • Method Magento\Catalog\Model\ImageExtractor::processImageBackground : The method return a string array
  • Magento\Framework\Image\Adapter\AbstractAdapter::backgroundColor : If the color is not an integer, the background is ignored.

Metadata

Metadata

Assignees

Labels

Fixed in 2.2.xThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: 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 releasebug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions