Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3994 closed defect (wontfix)

tiff image fails to load

Reported by: timaranz Owned by: warmerdam
Priority: normal Milestone: 1.9.0
Component: GDAL_Raster Version: 1.8.0
Severity: normal Keywords: GTIFF
Cc:

Description (last modified by warmerdam)

We cannot open a .tif file supplied to us by a customer.

gdal band.ReadRaster is returning None.
running gdal_translate with berry_geology.tif gives:
ERROR 1: PackBitsDecode:Not enough data for scanline 0
ERROR 1: TIFFReadEncodedStrip() failed.

ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0

The offending .tif file is confidential to our customer and may be obtained by emailing me at t dot mitchell at aranz dot com. Please do not add it to this publicly viewable ticket.

Change History (4)

comment:1 by warmerdam, 13 years ago

Description: modified (diff)
Resolution: wontfix
Status: newclosed

I have reviewed the file briefly, but without making a detailed dump of the problem scanlines. The file does appear to be incorrect, and GDAL responds to the error produced by libtiff.

Arguably it would be nice if GDAL could continue on, capturing as much data as possible, but that hasn't been typical policy in GDAL and I am hesitant to change it for fear of hiding serious error during processing.

I did notice that the tiff2rgba (or perhaps tiffcp) can be used to convert the file, with minimal data loss.

comment:2 by Even Rouault, 13 years ago

Ah, it would have been cool, dear reporter, to mention that you also provided the file to someone else, to avoid duplication of efforts from the mainteners.

Well, I agree with Frank's analysis, but at the time I read his comment, I already had commited a workaround in trunk (r21960). The default behaviour is unchanged : error. If you define the GTIFF_SKIP_PACKBITS_DECODE_ERROR configuration option to TRUE, GDAL will go on reading the image but some strips/tiles will be corrupted. In your case, the 4 first lines are corrupted, the next ones are OK. I verified this with gimp and globalmapper by zooming in on those 4 first lines.

Frank, are you OK with the commit or should I revert or change it ? I'm thinking that it would be perhaps wiser/more general purpose to offer the possibility to ignore TIFFReadEncodedStrip() error return code (without relying on what happened in GTiffErrorHandler())

comment:3 by warmerdam, 13 years ago

Component: defaultGDAL_Raster
Keywords: GTIFF added; tif removed

Even, I *feel* that this is an awfully specific change. I'd be more happy with it if it was a config option to tell the GTIFF driver to not error out no matter what read error happens in libtiff.

comment:4 by Even Rouault, 13 years ago

Milestone: 1.9.0

r21961 /trunk/ (3 files in 3 dirs): Revert r21960 to offer a much more general purpose GTIFF_IGNORE_READ_ERRORS configuration option (#3994)

Note: See TracTickets for help on using tickets.