t0k4rt / phpqrcode

php QRcode generator library
GNU Lesser General Public License v3.0
875 stars 389 forks source link

Image is broken when added into PDF with DOM library #51

Open hoffmana opened 3 years ago

hoffmana commented 3 years ago

Hi,

I am adding a qr code image to a pdf using DOM:

QRcode::png($qr_code, "qrcodereplace.png", "L", 4, 4); ... $dompdf = new DOMPDF(); Using external libraries from quickchart.io or chart.googleapis.com (quickchart) qr images was displayed correctly. But using self generated image png, then image was saved to own server correctly (qrcodereplace), but after inserting it into PDF it is broken (brokenqr)

I did image analysis of the png images with https://compress-or-die.com/analyze-process And all not working images have: ColorType Palette Each working ones have only difference here: ColorType RGB

Is there any way of changing ColorType of generated PNG or do you know any other issue that is causing this behaviour?

Thank you very much for your help.

Best regards,

Thomas