-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
PIL cannot read BigTIFF #4513
Comments
Could be a BigTIFF file, which is not supported by Pillow. The first 4 bytes in BigTIFF files are |
None of my tif files are BigTIFF, and they are all way under 4GB size |
Here is the information of my raster:
|
That's BigTIFF. |
Are there any plans to support bigtiff? I'd like to add my name to the list of people who would find it very useful. |
I've just stumbled upon this issue too. At a first glance, it seems to me that it should be pretty straightforward to modify src/libImaging/TiffDecode.c to handle the BigTIFF format, which is meant to be very closely compatible with the TIFF format. |
Ah, after working on this for about a day, and getting most of the way to a working solution, I realised that it is probably futile, as BigTIFF files are to a great extent used for medical images, and they will include multiple images within the file (for example, thumbnails). But PIL can only handle one image in a file, so this won't work very well. A better solution is probably to identify BigTIFF files (from the b"MM\x00\x2B" or b"II\x2B\x00" header bytes) and then recommend using something like tifffile to handle the image. If it's of interest, I could upload what I've done so far to github. (It's primarily work on TiffImagePlugin.py and TiffTags.py.) Best wishes! |
Pillow can load multiple images. It opens the file at one image, and then uses If you're willing to share what you've done, and an example image, that would be interesting. |
OK, shall do when I've had a chance to get at least some of it working! |
I've created PR #6097 to resolve this. |
What did you do?
I'm trying to open an orthomosaic geotiff into Python to crop into 1000x1000 tiles. I am able to open some tif files in my notebook, but other files return an UnidentifiedImageError. I have set up my notebook using a Dockerfile that creates a conda environment.
What did you expect to happen?
I expected that my code would work the same on all of my tif files - they are all 4-band 8-bit. This code works with a tif file that is 992 MB, but it doesn't work with a file that's 691 MB.
What actually happened?
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: