The Image constructor looks through its internal list of formats (depends on how PIL was compiled) and asks each one if it can parse the file.
As an input to the detector function, the first few bytes of the image file is used. By looking inside the TIFF image reader, it looks for one of the following magic bytes:
["MM\000\052", "II\052\000", "II\xBC\000"]
As indicated by the error message, the detector fails while reading the first few bytes of the file, way before it has gotten to read the dimensions of the image. One of the following reasons appear more likely:
- The file is corrupt
- The file is not a TIFF image
- The file is some exotic/new TIFF sub-format that PIL can't understand
And as for solution, I would suggest:
Use the
file
command to try to identify the file format, e.g.file orthoQB02_11JUL040015472-M1BS-101001000DB70900_u16ns3413.tif
which should print something like
Untitled.tiff: TIFF image data, big-endian
Try to open the file in e.g. Photoshop and see if it can understand the file.
- Inspect the header manually, see if the file starts with the magic bytes above.
EDIT: Since you identified the format (BigTIFF), you have two options: Convert it or find a Python library to load it. http://bigtiff.org has unofficial libtiff
versions with BigTIFF built in. You could try to compile pylibtiff against this libtiff version, or use ImageMagick (compiled with BigTIFF support) to convert the images to regular TIFF files first.