[gdal-dev] Reading JPEG2000 file related to drivers

Yves Jacolin yjacolin at free.fr
Tue Oct 13 02:55:14 PDT 2015


On Tuesday, October 13, 2015 11:25:47 Even Rouault wrote:
> 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

Exactly what I need, I should read this page one of this day because I know 
that it exists but never read it :)


> > * 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)
Interesting, so my thought to try with openjpg2000 is correct.

Thanks Even!

Y.



More information about the gdal-dev mailing list