Opened 19 years ago

Last modified 19 years ago

#975 closed defect (fixed)

Sparse TIFFs dont translate.

Reported by: warmerdam Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

 

Change History (2)

comment:1 by warmerdam, 19 years ago

It is easy to produce TIFFs with some/many "zero length, 
zero offset" strips or tiles with gdal_merge when there are 
areas with no files overlapping.  Subsequent attempts to 
gdal_translate these files result in errors like:

warmerda@gdal2200[154]% gdal_translate out.tif out2.tif
GDAL: GDALOpen(out.tif) succeeds as GTiff.

Input file size is 16801, 33600
0...ERROR 1: out.tif:0: Invalid strip byte count, strip 2400
ERROR 1: TIFFReadEncodedStrip() failed.

ERROR 1: IReadBlock failed at X offset 0, Y offset 2400
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 2400
GDAL: GDALClose(out.tif)

GDAL: GDALDeregister_GTiff() called.

comment:2 by warmerdam, 19 years ago

IReadBlock() has been altered in gdal/frmts/gtiff/geotiff.cpp to just returned
zeroed image values if the block does not exist on disk.  It was already doing
this for files open in update mode (under the assumption it had just been
created) but now applies this rule all the time so pre-existing files with zeroed
data can be read.

Arguable, gdal_merge.py should not be creating the file this way though.  It
will definately screw up some applications.  I'm not opening that can of worms
at this time though.


Note: See TracTickets for help on using tickets.