[gdal-dev] Reading JPEG2000 file related to drivers

Even Rouault even.rouault at spatialys.com
Tue Oct 13 02:25:47 PDT 2015


Salut Yves,

> 
> * is it possible to choose the driver used by gdal? For instance, in my
> second test, my gdal install have two driver; ECW SDK and OpenJpeg.
> Currently, I am building several gdal instance to test each driver :/

Yes, see https://trac.osgeo.org/gdal/wiki/ConfigOptions#GDAL_SKIP

For example if you want to exclude the JPEG2000 and JP2OpenJPEG drivers and 
only use JP2ECW:

GDAL_SKIP="JPEG2000,JP2OpenJPEG" gdalinfo foo.jp2

> * the difference between the two test, is it a problem from the driver used
> of from gdal release?

It is (mainly) a problem of the underlying library.
The JPEG2000 driver uses the jasper library which needs to decompress the 
whole imagine into memory. For some reason due to how jasper works, to get the 
infos displayed by gdalinfo, we also need to decompress the imagery. Could 
perhaps be made smarter, but as soon as you would need to query the value of a 
single pixel, the whole image would be uncompressed, so...
Other JPEG2000 drivers (and underlying libraries) are smarter and will only 
decompress(*) the requested area (and nothing for just a simple gdalinfo).

Even

(*) in the case of JP2OpenJPEG, this is only true if the JPEG2000 image is 
tiled. If it is made of a single tile, requesting just a few pixels will be 
slow (but will not need a lot of RAM as far as I remember)

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list