|TIFF and LibTiff Mail List Archive|
LibTiff Mailing List
2015.01.11 22:11 "Re: [Tiff] tools to validate a TIFF?", by Scott Ribe
So, OK, the header and single directory are fine, just as expected for this single-image, single-strip, binary image:
The question then is about the data in the strip. Is libtiff actually emitting invalid code words as claimed by certain utilities? Or are some TIFF readers broken?
The strip data begins with:
26 a0 78 28 20 3e 03 ec
And I'm getting that error message:
ImageIO: Fax4Decode Bad code word at line 1 of strip 0 (x 0)
So is that strip data valid or not? And if not, then I'll start tracing through libtiff to see how it comes to emit that data.
BTW, in my first post I mentioned having difficulty figuring out what the difference was between the flows which led to bad images vs good, because it seemed that I was using libtiff identically. Well, at a higher level there is a difference in cropping, and the data that results in bad images is likely to start with a long string of black pixels. I believe that G4 assumes the image starts with white, and if it starts with black requires a dummy code word indicating 0 white pixels at the start. That sure seems like where this could be going wrong--whether it's the writer or reader that is incorrect.