[gdal-dev] GeoTIFF with LZW compression Overviews error

Fabian Schindler fabian.schindler at eox.at
Wed Feb 13 09:01:55 PST 2013


Dear devs,

I'm experiencing strange errors when I try to add overviews to specific 
GeoTIFF files with internal tiling and LZW compression. This error shows 
only on some (about 3-5%) of the input files.

This is how I process the file:

$gdal_translate -gcp 0 0 19.09 49.22 -gcp 100 0 20.1 49.11 -gcp 100 401 19.27 45.89 -gcp 100 802 18.42 42.34 -gcp 100 1203 17.6 38.79 -gcp 100 1605 17.41 37.96 -gcp 0 1605 16.58 38.07 -gcp 0 1203 16.76 38.91 -gcp 0 802 17.53 42.45 -gcp 0 401 18.33 46.0 -of GTIFF -a_srs EPSG:4326 -co compress=LZW -co tiled=YES x.jpg x.tif

$gdalwarp -t_srs EPSG:4326 -co tiled=YES -co compress=LZW x.tif y.tif

$gdaladdo c.tif 2 4 8 16 32

0...10...20...30...40...50...60...70...80...90...Warning 1: c.tif:LZWDecode: Strip -1 not terminated with EOI code

ERROR 1: c.tif:LZWDecode: Not enough data at scanline 0 (short 46008 bytes)

ERROR 1: TIFFReadEncodedTile() failed.

ERROR 1: IReadBlock failed at X offset 0, Y offset 2

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

100 - done.

Any ideas/help on that?

Thanks in advance,
Fabian


FYI: I'm on a CentOS box with GDAL 1.9.1, released 2012/05/15, and 
libgeotiff 1.4.0-1.el6, and libtiff 3.9.4-6.el6_3.

A gdalinfo of the file shows:

Driver: GTiff/GeoTIFF

Files: x.tif

Size is 1497, 4965

Coordinate System is:

GEOGCS["WGS 84",

     DATUM["WGS_1984",

         SPHEROID["WGS 84",6378137,298.257223563,

             AUTHORITY["EPSG","7030"]],

         AUTHORITY["EPSG","6326"]],

     PRIMEM["Greenwich",0],

     UNIT["degree",0.0174532925199433],

     AUTHORITY["EPSG","4326"]]

Origin = (9.291424276853256,49.550154279390341)

Pixel Size = (0.007350754725447,-0.007350754725447)

Metadata:

   AREA_OR_POINT=Area

Image Structure Metadata:

   COMPRESSION=LZW

   INTERLEAVE=PIXEL

Corner Coordinates:

Upper Left  (   9.2914243,  49.5501543) (  9d17'29.13"E, 49d33' 0.56"N)

Lower Left  (   9.2914243,  13.0536571) (  9d17'29.13"E, 13d 3'13.17"N)

Upper Right (  20.2955041,  49.5501543) ( 20d17'43.81"E, 49d33' 0.56"N)

Lower Right (  20.2955041,  13.0536571) ( 20d17'43.81"E, 13d 3'13.17"N)

Center      (  14.7934642,  31.3019057) ( 14d47'36.47"E, 31d18' 6.86"N)

Band 1 Block=256x256 Type=Byte, ColorInterp=Red

   Overviews: 749x2483, 375x1242, 188x621, 94x311, 47x156

Band 2 Block=256x256 Type=Byte, ColorInterp=Green

   Overviews: 749x2483, 375x1242, 188x621, 94x311, 47x156

Band 3 Block=256x256 Type=Byte, ColorInterp=Blue

   Overviews: 749x2483, 375x1242, 188x621, 94x311, 47x156





More information about the gdal-dev mailing list