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

Add numpy array interface support for 16 and 32 bit integer modes #347

Merged
merged 1 commit into from
Sep 30, 2013
Merged

Conversation

cgohlke
Copy link
Contributor

@cgohlke cgohlke commented Sep 30, 2013

Fix issue #273.
Please review.
Needs test.

@wiredfool
Copy link
Member

I'll try to exercise this tomorrow morning.

Having added this, do you have any ideas about why this is labeled broken? https://github.com/cgohlke/Pillow/blob/9bff0b14e0b4e3b6f53d2251c186f208125bd7d9/PIL/Image.py#L217

@cgohlke
Copy link
Contributor Author

cgohlke commented Sep 30, 2013

It looks like the tobytes function does not work correctly for mode 1 images. For a 73x76 1 bit TIFF file the function returns 760 bytes (not 5548 bytes), the size of the undecoded image data in the file.

aclark4life added a commit that referenced this pull request Sep 30, 2013
Add numpy array interface support for 16 and 32 bit integer modes
@aclark4life aclark4life merged commit 78a41bd into python-pillow:master Sep 30, 2013
@wiredfool
Copy link
Member

Ok, I've had a chance to review this. The Unsigned 16bit Integer modes work as expected. The others appear correct, but I don't think you can actually make an image with those modes. You can't make a new image or convert to them. It looks like you can read a 16bit signed tiff, and there are several plugins that read 32 bit int images. It appears that they're always stored in local endianess.

Summary: I think they're right, and even if they're not, it's not going to be that damaging since it's really hard to make that type of images, and if there is a problem, we can fix the format code easily.

@gregcotten
Copy link

So what is the exact status of this?

@cgohlke
Copy link
Contributor Author

cgohlke commented Nov 4, 2013

This PR has been merged and closed.

radarhere pushed a commit to radarhere/Pillow that referenced this pull request Sep 24, 2023
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.

4 participants