endroid / qr-code

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

Trouble running tests on PHP 8 with github actions using this lib #282

Closed francislavoie closed 3 years ago

francislavoie commented 3 years ago

See https://github.com/Vectorface/GoogleAuthenticator/pull/2

You can see the test failures here: https://github.com/Vectorface/GoogleAuthenticator/pull/2/checks?check_run_id=1484500680

FYI the dependency of this lib that is causing failures in your builds is now fixed to support PHP 8: https://github.com/khanamiryan/php-qrcode-detector-decoder/issues/98 with this release: https://github.com/khanamiryan/php-qrcode-detector-decoder/releases/tag/1.0.4

I'm not sure why GD would be failing on PHP 8. This lib doesn't emit any useful information as to why it might be the case. It definitely gets past the check for the extension being loaded, but then it fails on imagecreatetruecolor()

https://github.com/endroid/qr-code/blob/ad1aa6ca3abbbfe5ac072029d6f9bda7aafd957f/src/Writer/PngWriter.php#L71-L75

francislavoie commented 3 years ago

Ohhh - I think it's actually because gd doesn't return resources anymore in PHP 8, but objects now.

https://github.com/php/php-tasks/issues/6

https://github.com/php/php-src/pull/4714

endroid commented 3 years ago

Hi @francislavoie this should be fixed.

acelaya commented 3 years ago

Hey!

In what version is this fixed? Because I'm using 3.9.6 (which seems to be the latest one), and I can still see this errors.

Also, If I check the source code inside my vendor folder, it's still doing this is_resource calls.

Am I missing something? 🤔

endroid commented 3 years ago

Hi @acelaya this should be fixed in the 3.x branch and awaiting update of an external library before it completely supports PHP 8 and can be tagged.

acelaya commented 3 years ago

Perfect. Thanks for the info.

ThibaudDauce commented 3 years ago

@endroid Can we help for something to tag a new release?

endroid commented 3 years ago

@ThibaudDauce unfortunately I think not :) I hope to have a 4.x release soon which allows usage of the library without requiring that package but for now if you need to run in PHP 8 you can use the temporary workaround mentioned in https://github.com/endroid/qr-code/issues/292.