Closed Huseriato closed 4 years ago
Hi @Huseriato what exactly is the issue when alpha channel information is saved, besides the small increase in file size?
I want to add this QR-Code to a bill, using FPDF. I'm using an older version of this lib (update not possible), which supports no alpha channel for png. The only other supported image format is jpg, but qr-code lib can't generate jpegs.
However, if the background of the qr code is fully opaque, there is no need to save an alpha channel for the resulting png.
Hi @Huseriato the current master includes the fix.
This is the code I used:
What I found in
Writers/PngWriter.php
inside functioncreateInterpolatedImage
isimagesavealpha($image, true);
, which is always set. If I remove the line, all is fine. I tried this:So the alpha channel is only activated, if the background is opaque. But I don't know, if this should be the way to do this.