Fixed bug in decoding large images#3791
Merged
hugovk merged 1 commit intopython-pillow:masterfrom May 4, 2019
Merged
Conversation
Member
|
#1475 (comment) suggests changing all What are the pros and cons of using |
Member
Author
|
It didn't occur to me that I've also changed the other decoders as well, to fix a compilation warning. |
|
Many PIL operations are working for me for image manipulations of images over 32 bit in size, which is fantastic. However, I still have a problem with fromarray even after this fix (tested using PIL version 6.1.0 and numpy version 1.16.4): The test case is relatively simple: from PIL import Image
import numpy as np
# this works
a = np.zeros((46340, 46340), dtype=np.uint8)
b = Image.fromarray(a)
del a,b
# this works
b = Image.new('L', (46341, 46341))
del b
# this does not work, fails with:
# MemoryError: Integer overflow in ysize
a = np.zeros((46341, 46341), dtype=np.uint8)
b = Image.fromarray(a)This is likely because 46341*46341 > 2^31-1 |
Member
Author
|
@elhuhdron could you open a new issue with your problem? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1475