Repository navigation
cannot identify image file #1602
Description
Activity
The currently supported TIFF prefixes are
MM\000\052,II\052\000, andII\xBC\000This TIFF has a prefix of
II*\x00that is, we move on wand?
It's an invalid image. It's tagged as little-endian, but with a big-endian magic number.
(Where the magic number is 42, as an int16)
http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
Bytes 0-1: The byte order used within the file. Legal values are: “II” (4949.H) “MM” (4D4D.H) In the “II” format, byte order is always from the least significant byte to the most significant byte, for both 16-bit and 32-bit integers This is called little-endian byte order. In the “MM” format, byte order is always from most significant to least significant, for both 16-bit and 32-bit integers. This is called big-endian byte order. Bytes 2-3 An arbitrary but carefully chosen number (42) that further identifies the file as a TIFF file. The byte order depends on the value of Bytes 0-1.It's an invalid image.
I don't think
II*\x00is invalid for TIFF:struct.unpack('<H', b'*\x00')[0] == 42
That should teach me to comment quickly before leaving for the weekend.
This one is returning a format key of:
format key: ('II', 1, (1,), 1, (16, 16), (2,))Which is not one that we support. Specifically, multiband images with bit depth > 8 bit are not supported anywhere in the code.
Having the same problem with single-channel paletted TIFF, created by GDAL, tiffinfo as follows:
TIFFReadDirectory: Warning, Unknown field with tag 33550 (0x830e) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 33922 (0x8482) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 34735 (0x87af) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 34737 (0x87b1) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 42113 (0xa481) encountered.
TIFF Directory at offset 0x34293c6 (54694854)
Image Width: 10774 Image Length: 12577
Bits/Sample: 16
Sample Format: unsigned integer
Compression Scheme: LZW
Photometric Interpretation: palette color (RGB from colormap)
Samples/Pixel: 1
Rows/Strip: 1
Planar Configuration: single image plane
Color Map: (present)
Tag 33550: 4.999617,4.999789,0.000000
Tag 33922: 0.000000,0.000000,0.000000,679006.067110,9955209.915048,0.000000
Tag 34735: 1,1,0,7,1024,0,1,1,1025,0,1,1,1026,34737,22,0,2049,34737,7,22,2054,0,1,9102,3072,0,1,32736,3076,0,1,9001
Tag 34737: WGS 84 / UTM zone 36S|WGS 84|
Tag 42113: 0
Predictor: horizontal differencing 2 (0x2)That's actually a different issue, as it's a single channel image. (Though, palette, which may add wrinkles for support). Can you post the image?
Yea I'll make a sample. Will get it to you next week.
and it's me again :)
a35e6972-f868-42e4-86ac-42a6162c9c3e.tiff.tif.zip
unzip and load
And viewers show this file without problems. Not segfault, but bug. Nasty bug.