Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
francislavoie opened this issue Dec 2, 2020 · 7 comments
Closed
Assignees
Labels

Comments

@francislavoie
Copy link

francislavoie commented Dec 2, 2020

See Vectorface/GoogleAuthenticator#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: khanamiryan/php-qrcode-detector-decoder#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()

$image = imagecreatetruecolor($data['block_count'] * $baseSize, $data['block_count'] * $baseSize);
if (!is_resource($image)) {
throw new GenerateImageException('Unable to generate image: check your GD installation');
}

@francislavoie
Copy link
Author

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

php/php-tasks#6

php/php-src#4714

francislavoie added a commit to francislavoie/php-qrcode-detector-decoder that referenced this issue Dec 2, 2020
See endroid/qr-code#282 and endroid/qr-code#283

Turns out PHP 8 changed `gd` to return objects rather than resources. This should work as a quick fix to not throw an exception in PHP 8.
@endroid
Copy link
Owner

endroid commented Dec 2, 2020

Hi @francislavoie this should be fixed.

@endroid endroid closed this as completed Dec 2, 2020
@endroid endroid self-assigned this Dec 2, 2020
@acelaya
Copy link

acelaya commented Dec 13, 2020

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
Copy link
Owner

endroid commented Dec 13, 2020

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
Copy link

acelaya commented Dec 13, 2020

Perfect. Thanks for the info.

@ThibaudDauce
Copy link

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

@endroid
Copy link
Owner

endroid commented Jan 29, 2021

@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 #292.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants