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 bug with pixel counts over 2^30 #315

Merged
merged 4 commits into from
Jul 6, 2024
Merged

Conversation

qbnu
Copy link
Contributor

@qbnu qbnu commented Jun 22, 2024

It turns out GDI+ can't handle bitmaps that are over INT_MAX (2^32 - 1) in size. After a0217d8 we get a ValueOverflow error when calling LockBits. I changed the code to add a workaround for PNG and JPEG images, and set isOutOfMemory when we get a ValueOverflow.

I used this image to test: #187 (comment)
Also converted it to a JPEG and tested that

@qbnu qbnu marked this pull request as draft June 22, 2024 21:21
@qbnu qbnu changed the title fix bug with pixel counts over INT_MAX/4 fix bug with pixel counts over 2^30 Jun 23, 2024
@qbnu qbnu marked this pull request as ready for review June 23, 2024 05:37
@sylikc sylikc added bug Something isn't working format support Related to add/remove/change of a specific format support. labels Jul 3, 2024
@sylikc sylikc merged commit a78d436 into sylikc:master Jul 6, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working format support Related to add/remove/change of a specific format support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants