Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opacity png watermark became white box on product images #10661

Closed
Koc opened this issue Aug 25, 2017 · 18 comments
Closed

Opacity png watermark became white box on product images #10661

Koc opened this issue Aug 25, 2017 · 18 comments
Assignees
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@Koc
Copy link

Koc commented Aug 25, 2017

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

@Koc
Copy link
Author

Koc commented Aug 25, 2017

#9662 not fixes this issue :(

@orlangur
Copy link
Contributor

Did it work with JPEG anytime before?

@orlangur
Copy link
Contributor

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

Watermark attached is PNG-8 though.

@Koc
Copy link
Author

Koc commented Aug 25, 2017

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.

@magento-engcom-team magento-engcom-team added G1 Passed bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Sep 15, 2017
@magento-engcom-team
Copy link
Contributor

@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

@Koc
Copy link
Author

Koc commented Sep 18, 2017

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

@magento-engcom-team
Copy link
Contributor

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

@Koc
Copy link
Author

Koc commented Sep 19, 2017

does needs update label should be removed or not?

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development and removed Progress: needs update labels Sep 19, 2017
@Echron
Copy link
Member

Echron commented Sep 26, 2017

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

@jissereitsma
Copy link
Contributor

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.

@Echron
Copy link
Member

Echron commented Sep 26, 2017

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

elzekool added a commit to elzekool/magento2 that referenced this issue Sep 27, 2017
The watermark functionality uses imagecopymerge for copying the
watermark into the image, this function loses the alpha information.

Therefor use imagecopy for 100% opacity and use imagefilter in other
cases.

Resolves: magento#10661
@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Jan 29, 2018
@magento-engcom-team
Copy link
Contributor

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

The fix will be available with the upcoming patch release.

VincentMarmiesse pushed a commit to VincentMarmiesse/magento2 that referenced this issue Jan 31, 2018
Fixed issues:
- MAGETWO-81802: Magento 2.2.0rc23: Customer Grid Indexer not working magento#10838
- MAGETWO-84448: Product Import does not allow store-specific Custom Option labels
- MAGETWO-85207: Customer's order grid is not displaying
- MAGETWO-86657: Import existing customer with only three columns will override customer group_id and store_id
- MAGETWO-86154: Wrong page cached for logged in user
- MAGETWO-83293: Inefficient SQL query on applying filter on sales order grid
- MAGETWO-83343: Customer shopping cart not accessible in admin order
- MAGETWO-85708: Zoom the image can't be closed by iPhone with Safari browser

MAGETWO-87132: Remove JsTestDriver from Magento codebase

MAGETWO-84219: Creditmemo comment via REST api does not send creditmemo update email

MAGETWO-84219: Creditmemo comment via REST api does not send creditmemo update email

MAGETWO-86452: [Backport for 2.2.x] Update copyright year

alignement array assignement

For Your Eyes Only

Remove whitespace at end of line

FIX: out-of-stock options for configurable product visible on frontend as sellable

Adapt \Magento\Analytics\Block\Adminhtml\System\Config\CollectionTimeLabel::render method to use current locale to render time zone label, as done in \Magento\Framework\Locale\TranslatedLists::getOptionTimezones

Handle transparncy correctly for watermark

The watermark functionality uses imagecopymerge for copying the
watermark into the image, this function loses the alpha information.

Therefor use imagecopy for 100% opacity and use imagefilter in other
cases.

Resolves: magento#10661

Fix handling of watermark with alpha for Imagick

When adding a watermark that already has an alpha channel this was reset
because the overal opacity was set for the image. Instead we should
multiply the original alpha with the requested opacity

Handle non true color images with GD2

Add integration test for watermark with alpha

Added integration tests for handling alpha transparency in watermarks.
Renamed the current test for watermarks as it only tests if the
watermark is correctly places

Fix issues with static tests

Remove ui-state-active from siblings of the expanded menu item

Previously when a menu item was expanded the class `ui-state-active` was
not removed from the previous expanded menu item. This resulted in two
(or more if you expanded more) menu items with this class.

Clean region when select country

:bug: add fallback for Product_links position attribute if position index was not set in API request

:ok_hand: shortening variable name

:bug: fix variable re-naming

:ok_hand: drop multiple empty lines

:ok_hand: closing parenthesis and the opening brace of a multi-line function on the same line

:ok_hand: closing parenthesis and the opening brace of a multi-line function on the same line

:ok_hand: reset protected variable naming

:ok_hand: rename isPositionsSet function to isPositionSet to keep consistency

Fix typo

:ok_hand: apply code enhancement

:ok_hand: apply code enhancement

Add type hint
@sanderjongsma
Copy link
Contributor

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

@chakravarthykalyan90
Copy link

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

@janssentwh
Copy link

janssentwh commented Nov 4, 2019

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:

@vishalpatel14
Copy link

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

@ivanaugustobd
Copy link

Here we "solved" it by using 99% opacity instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests