Magento2: Opacity png watermark became white box on product images

Created on 25 Aug 2017  路  17Comments  路  Source: magento/magento2


Preconditions


  1. Magento 2.1.8
  2. PHP 7.0.21

Steps to reproduce

  1. Create product with jpeg images
  2. Configure use transparent png watermark (attached to ticket above)
    watermark_1

Expected result

  1. expected image with waternark on bottom like
    le_lis

Actual result

  1. got image with white box instead of nice watermark
    le_lis

Addtional info

opacity = 100% (because png has own opacity)
size=empty string
position=bottom/right

Fixed in 2.2.x Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x

Most helpful comment

I will try to reproduce it and see if i can fix it

All 17 comments

9662 not fixes this issue :(

Did it work with JPEG anytime before?

Possibly related https://stackoverflow.com/a/11681066 https://stackoverflow.com/a/38591492.

Watermark attached is PNG-8 though.

Did it work with JPEG anytime before?

not sure. For Magento1 I had used own small "microservice" based on Symfony and Imagine library. And it works ok, see above.

@Koc Thank you for your report.
How exactly did You set up watermark? Please give parameters from Content > Design > Configuration > You website > Product Image Watermarks

@magento-engcom-team
opacity = 100% (because png has own opacity)
size=empty string
position=bottom/right

Hi @Koc thank you for the update. We updated issue description

does needs update label should be removed or not?

@Koc, thank you for your report.
We've created internal ticket(s) MAGETWO-75507 to track progress on the issue.

I will try to reproduce it and see if i can fix it

I tried to reproduce this and can reproduce it with a cat image (PNG-8) and the GD adapter AND the ImageMagick adapter. When I encountered these issues before they actually depended on the version of GD and/or Imagick and/or PHP.

PS: I tried a transparent GIF as well and I ended up in a non-transparent watermark, so that's another fail.

This should be fixed by @elzekool, we tested the solution

Hi @Koc. Thank you for your report.
The issue has been fixed in magento/magento2#11060 by @elzekool in 2.2-develop branch
Related commit(s):

  • 92f24eccffdab3beafc0957a14f2603a5a0d0669
  • 6581e80c0b125ab691d27d4b0c603552b55896ef
  • f2446b637679ed7d39dd73b54c13f2bd0d3e45a6
  • 519f3e1c608e0ee0105f8cec0244b822c3d17cee
  • 00a5c3a2f53c5c880210157fa44648688c212070
  • 503204c04627454ebe7e59e076089de640b8fe8b

The fix will be available with the upcoming patch release.

Looks like this bug is re-introduced in version 2.2.5, can anyone confirm this?

We are facing similar issue in 2.2.7. Gif image transparent background is changed to black.

I am still facing this bug in 2.3.3. The alpha channel of the watermark seems to be replacing the alpha channel of the product image. This causes a box of transparency to appear around the watermark:

This issue still exit in latest 2.3.4 version downloaded from Magento Market place.

Was this page helpful?
0 / 5 - 0 ratings