Skip to content

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

Merged
SRWieZ merged 2 commits into
SRWieZ:masterfrom
jimwins:patch-2
Feb 11, 2024
Merged

fix: throw an Exception when GD can't decode the image data#8
SRWieZ merged 2 commits into
SRWieZ:masterfrom
jimwins:patch-2

Conversation

@jimwins

@jimwins jimwins commented Jan 31, 2024

Copy link
Copy Markdown
Contributor

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

SRWieZ commented Feb 7, 2024

Copy link
Copy Markdown
Owner

Hi! Thanks for the contribution.

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

@jimwins

jimwins commented Feb 10, 2024

Copy link
Copy Markdown
Contributor Author

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
@SRWieZ

SRWieZ commented Feb 11, 2024

Copy link
Copy Markdown
Owner

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.

2 participants