2001.03.27 13:29 "LibTiff encapsulator design issue: multipage tiffs with faulty pages", by Joris Van Damme


When a multipage tiff has one or more faulty pages, and one or more perfectly readable pages, I guess a good LibTiff encapsulator should be able to both read the readable pages and report clear errors for the others. My real problem here is to distinguish between local page errors and global tiff file errors.

Errors occuring while decompressing the actual image color data, are clearly local page errors and should not prevent the decoder from having a go at other subsequent pages (I think).

But errors occuring while reading TIFF tag data in a particular TIFF image directory are a bit of a problem. When should the LibTiff encapsulator give up on the file, and when should it regard the error as local and continue with another TIFFReadDirectory, presuming this will not return nonsence or crash or anything? I guess analyzing the actual textual error reported might be usefull, but I resent doing this since it does not seem elegant at all, and does make it difficult to ever localize error strings. The only other option I can think of wright now is adding a parameter to the error routine in which LibTiff code can report whether the error should be regarded as global or local to the current page. But this does involve some work inside LibTiff, so it does not seem such a good option either.

If a good multipage supporting tiff reader does not solve this problem, it can miss out on multipage tiffs with a good first page perfectly readable by any mediocer singlepage tiff reader. So I do want to handle it properly.

Any comments, ideas, advice, whatsoever, anyone? Thanks!