AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
May 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2005.05.31 19:41 "hot to detect corrupt tif file", by Gordon Hu
2005.05.31 23:46 "Re: hot to detect corrupt tif file", by Bruno Ledoux
2005.05.31 23:52 "Re: hot to detect corrupt tif file", by Edward Lam
2005.05.31 23:56 "Re: hot to detect corrupt tif file", by Andy Cave
2005.06.01 00:02 "Re: hot to detect corrupt tif file", by Bob Friesenhahn
2005.06.01 00:11 "Re: hot to detect corrupt tif file", by Andy Cave
2005.06.01 00:45 "Re: hot to detect corrupt tif file", by Bob Friesenhahn
2005.06.01 00:50 "Re: hot to detect corrupt tif file", by Andy Cave
2005.06.01 01:02 "Re: hot to detect corrupt tif file", by Bob Friesenhahn
2005.06.02 13:21 "Re: how to detect corrupt tif file", by Gordon Hu
2005.06.02 15:11 "Re: how to detect corrupt tif file", by <melser.anton@gmail.com>
2005.06.02 15:38 "Re: how to detect corrupt tif file", by Edward Lam
2005.06.02 15:50 "Re: how to detect corrupt tif file", by <melser.anton@gmail.com>

2005.05.31 23:56 "Re: hot to detect corrupt tif file", by Andy Cave

Hi Gordon.

Two things that 'work':

1. Do a basic open on the tiff file. If that succeeds, you've got a good 
chance it's a tiff file.
2. Read the band/tile offsets & sizes, and check that 'they make sense' - 
that is that each band/tile offsets & offset+size lies within the physical 
size of the file (assuming it's a file). If the file is corrupt, there is a 
good chance that this will fail.

After that, the only thing you can do to check there is no corruption, is to 
read each band/tile (and decompress it et al). But that's a lot of overhead.

So, I'd suggest the first 2. We do that with our product FirstPROOF, and it 
seems to be a reasonable catch of corrupt files.

Andy.

Andy Cave,
Chief Executive Officer,
Hamillroad Software Limited.
www.firstproof.com
www.hamillroad.com