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

fix: throw an Exception when GD can't decode the image data #8

Merged
merged 2 commits into from Feb 11, 2024

Conversation

jimwins
Copy link
Contributor

@jimwins jimwins commented Jan 31, 2024

This throws a more descriptive exception when GD fails to decode the image, which is likely to be because GD doesn't have support for that image type. Before, it would just fail on the subsequent call to imagesx().

This throws a more descriptive exception when GD fails to decode the image, which is likely to be because GD doesn't have support for that image type. Before, it would just fail on the subsequent call to imagesx().
@SRWieZ
Copy link
Owner

SRWieZ commented Feb 7, 2024

Hi! Thanks for the contribution.

Before merging, can you provide an image that is failing so we can write a test for that?

@jimwins
Copy link
Contributor Author

jimwins commented Feb 10, 2024

You don't need a specific image, you can just feed it any non-image data, like extract_size_and_pixels_with_gd("this will fail").

@SRWieZ SRWieZ merged commit 2d5c623 into SRWieZ:master Feb 11, 2024
4 checks passed
@SRWieZ
Copy link
Owner

SRWieZ commented Feb 11, 2024

Fair enough. I added tests. Thank you for your contribution!

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

Successfully merging this pull request may close these issues.

None yet

2 participants