-
-
Notifications
You must be signed in to change notification settings - Fork 771
Generated png is not reproducible anymore if same code is ran in a different env #470
Description
Our CI test broke after upgrading from 6.0.3 to 6.0.4. Locally we use a php container and in the CI we just run it in the CI Github runner (Ubuntu 24). I believe because it's ran in a different environment with differently compiled PHP (and GD extension) the output of imagetruecolortopalette is not consistent even if the provided arguments are the same.
Perhaps we shouldn't snapshot test the base64 output of the QR code in the first place, but at the very least I wanted to report this change in output.
The change that is causing my current problem can be found here: https://github.com/endroid/qr-code/blob/main/src/Writer/Result/PngResult.php#L24
Diff between 6.0.3 vs 6.0.4:
74b62f4#diff-5d46da5b28b5ad39f4093489d68d3a46fefaf23455e18b965d9f465de84f265b
I also tried to get the old behaviour by setting the following writer options: [PngWriter::WRITER_OPTION_NUMBER_OF_COLORS => null]. But that won't work because an isset() check on such element would still return false.