Closed lyekumchew closed 3 years ago
@lyekumchew could it be because your image has no transparency?
@lyekumchew could it be because your image has no transparency?
The four red frames on the image show white because my background color is white. If it is black, the four places are shown as black. Merge images are mentioned in the code.
https://avatars0.githubusercontent.com/u/7749926?s=400&v=4
Interesting. Is this happening on 4.0.0?
Interesting. Is this happening on 4.0.0?
I've tried versions 3.0.0 and 4.0.0, both of which have this problem.
Thanks for reporting. It appears to be an image transparency bug with the PNG resampling. The method calls will need to be adjusted to fix this correctly. I'll resolve it when I have time, or if someone want to jump in you can find the code here: https://github.com/SimpleSoftwareIO/simple-qrcode/blob/develop/src/ImageMerge.php#L110
This will likely be fixed with https://github.com/SimpleSoftwareIO/simple-qrcode/issues/192
@SimplyCorey can I ask why we need ext-magick
? For the gradient rendering?
@SimplyCorey , @bilogic I achieved this a couple of days back. The idea is to create a transparent background with the image. If @bilogic is on this fine, I can pass else I could send a PR. Here is what I got. I could blend any image at any point. NB I made it transparent cause I needed to achieve the twitter QR code effect. Check https://twitter.com/muarachmann/status/1312453668520693762?s=20
@SimplyCorey can I ask why we need
ext-magick
? For the gradient rendering?
This extension in general is needed to manipulate images in php. just like you will need mysqli
to connect to any mysql db instance. This doesn't come by default with php i think so you need to install it. You can as well go with gd
I think
@muarachmann I asked because endroid did not need ext-magick
, and I never had to use it too even though I generate PNGs for other purposes.
@muarachmann I asked because endroid did not need
ext-magick
, and I never had to use it too even though I generate PNGs for other purposes.
Yes @bilogic they use GD
see https://github.com/endroid/qr-code/issues/233 like I said you can have one or use the other. Either way, you must have one of these image Library. I think here imagick was the preferred one
I'm kind of surprised endroid doesn't require ext-magick
as they use the same underlying qrcode library. They must have created their own writer to get around that.
@muarachmann I would be interested in seeing a PR and how you went about this. It might solve #192 as well although that might take a different approach to make the overlays look cleaner.
@SimplyCorey
ext-magick
, perhaps you want to consider moving to gd
?I know I'm digressing, let me know if I should open another issue. Thanks.
When a picture with transparency (PNG) is merged into a QR code, the four red boxes display the transparent part instead of the QR code. I can't do it like a demo.
simple-qrcode version: 3.0.0 PHP 7.3.23 (cli) (built: Oct 1 2020 21:10:33) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.23, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.23, Copyright (c) 1999-2018, by Zend Technologies