[gdal-dev] converting ECW to GTiff for Linux

Micha Silver tsvibar at gmail.com
Sat Mar 4 13:27:51 PST 2017



On 03/04/2017 09:42 PM, Even Rouault wrote:
>
> On samedi 4 mars 2017 18:55:03 CET Micha Silver wrote:
>
> > Hello:
>
> > (I'm double posting as this problem is somewhere between GDAL and QGIS.)
>
> >
>
> > I have converted an ECW compressed aerial photo to geotiff with JPEG
>
> > compression on a Windows computer with gdal_translate. The resulting tif
>
> > image displays fine with QGIS on the Windows machine.  GDAL version 
> 2.1.3
>
> > on the Windows computer, and QGIS 2.18.4 My command was similar to:
>
> > gdal_translate -of GTiff -projwin ..... -co TILED=YES -co TFW=YES -co
>
> > COMPRESS=JPEG -co PHOTOMETRIC=YCBCR in.ecw out.tif
>
> >
>
> > I then copy the tif (and tfw) to my Linux machine, and try to open with
>
> > QGIS, but QGIS crashes immediately. I should note that gdalinfo 
> shows full
>
> > information on both the Windows and Linux systems. On the Linux computer
>
> > GDAL is 2.1.2 and QGIS is 2.18.4 .
>
> On the Linux system where this crashes with QGIS, could you do :
>
> gdalinfo -checksum -stats the.tif
>
> If this crashes, the issue is clearly in GDAL. Otherwise it is likely 
> in QGIS.
>
No crash, but I do see a Warning:

gdalinfo -checksum -stats kidron_e2.tif Driver: GTiff/GeoTIFF Files: 
kidron_e2.tif Size is 45200, 36000 ....

Warning 1: JPEGLib:Premature end of JPEG file Minimum=0.000, 
Maximum=255.000, Mean=163.947, StdDev=38.307 Checksum=49932 Metadata: 
STATISTICS_MAXIMUM=255 STATISTICS_MEAN=163.94735676131 
STATISTICS_MINIMUM=0 STATISTICS_STDDEV=38.30668730016 Band 2 
Block=256x256 Type=Byte, ColorInterp=Green Description = Green 
Minimum=0.000, Maximum=255.000, Mean=167.305, StdDev=32.125 Checksum=52 
Metadata: STATISTICS_MAXIMUM=255 STATISTICS_MEAN=167.3047566274 
STATISTICS_MINIMUM=0 STATISTICS_STDDEV=32.124800654502 Band 3 
Block=256x256 Type=Byte, ColorInterp=Blue Description = Blue 
Minimum=0.000, Maximum=255.000, Mean=146.241, StdDev=31.604 
Checksum=11457 Metadata: STATISTICS_MAXIMUM=255 
STATISTICS_MEAN=146.24062233882 STATISTICS_MINIMUM=0 
STATISTICS_STDDEV=31.603809219917

Also I have found that creating overlays seems to solve the problem 
(?!). After running:

gdaladdo --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW 
YCBCR --config INTERLEAVE_OVERVIEW PIXEL -r average kidron_e2.tif 2 4 8 16

the tiff opens fine in QGIS.

Regards,

Micha

> >
>
> > Any ideas what could be the cause of QGIS crashing with the 
> gdal_translate
>
> > converted tif image? Is there something that needs to be done on 
> windows to
>
> > create a Linux usable geotiff??
>
> >
>
> > Thanks
>
> -- 
>
> Spatialys - Geospatial professional services
>
> http://www.spatialys.com
>

-- 
Micha Silver
cell: +972-523-665918



More information about the gdal-dev mailing list