endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.46k stars 728 forks source link

PHP8 GD problems #306

Closed fmassei closed 3 years ago

fmassei commented 3 years ago

From PHP 8.0 and forward, GD extension uses \GdImage class objects instead of resources.

this means that all the is_resources checks if (!is_resource($image)) should be expanded with the new if (!is_resource($image) && !($image instanceof \GdImage))

Otherwise the PngWriter class just doesn't work (saying there's a problem with GD!)

I didn't pull-request because I can't try with previous versions of php (<8.0) and I don't know if the GdImage class needs a polyfill (it probably does, I guess).

endroid commented 3 years ago

Hi @fmassei version 4.x should support php 8.0 and GdImage objects.