AWARE [SYSTEMS]
AWare Systems, , Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
June 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
Archive maintained by AWare Systems



New Datamatrix section



Valid HTML 4.01!



Thread

2005.06.17 19:49 "Fix for corrupted multipage TIFF", by Steve Roy
2005.06.20 15:01 "Re: Fix for corrupted multipage TIFF", by Frank Warmerdam
2005.06.23 14:38 "Re: Fix for corrupted multipage TIFF", by Steve Roy
2005.06.23 15:43 "Re: Fix for corrupted multipage TIFF", by Frank Warmerdam
2005.06.23 19:08 "Re: Fix for corrupted multipage TIFF", by Andrey Kiselev

2005.06.20 15:01 "Re: Fix for corrupted multipage TIFF", by Frank Warmerdam

On 6/17/05, Steve Roy <sroy@mac.com> wrote:
> 
> We use LibTiff to read multipage TIFFs. We found a case where the first page
> is invalid while the other pages are fine. Unfortunately TIFFOpen returns
> NULL in such a case because the code tries to load the first page and fails
> so it assumes everything else is bad. I found a fix that we would like to
> submit but not being that familiar with the code I would like to run it by
> you guys.
> 
> The fix is at the end of the TIFFClientOpen() function in tif_open.c. It
> goes like this, with my changes annotated by STEVE.

Steve,

My concern with this sort of change for handling messed up files
is that it makes it very hard for applications to know if things are going
OK.  I would add that there are alot of ways that TIFFReadDirectory()
can fail, and alot of them will not allow for graceful recover if you keep
using the TIFF*.

If we were to incorporate such handling, I think it might be best to 
control whether it is used based on an extra open flag indicating
that an error should not cause complete failure.  

However, it is annoying that currently applications have no chance
to recover from errors in reading the first directory that would be
non-fatal in other directories. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent