[gdal-dev] JP2k, ReadError, Python

Even Rouault even.rouault at mines-paris.org
Sat Jul 30 13:44:46 EDT 2011


Le samedi 30 juillet 2011 19:14:17, Jay L. a écrit :
> Here is the link.  As I said, it is 28MB, including the .jp2, .aux.xml, and
> .prj file.
> 
> http://www.personal.psu.edu/jzl5325/CTX.zip
> 
> I would have thought that unloading the JPEG2000 driver would have forced
> the ECW driver to be used.  It looks to me as if that driver is not being
> used although it is in the ProgramFiles/GDAL/gdalplugins directory.   What
> is the best way to check for proper installation?

Hum, I'm confused : the JP2ECW driver works with gdalinfo, but not with python 
?

Under the Python console, you can try :
print(gdal.GetDriverByName('JP2ECW'))

If it returns None, then it's clear there's an issue with your setup.

And you should'nt have to unload the JPEG2000 driver because JP2ECW should be 
used before, due to the order in which the drivers are registered.

So I suppose that the GDAL_DRIVER_PATH env variable isn't defined or doesn't 
point to the gdalplugin directory when you run your python script.

I've tried on my (Linux) box and I can successfully run 
ComputeRasterMinMax(False) with the JP2ECW driver on your file.

> 
> Again, many thanks,
> Jay
> 
> > Ah ok, so it is the Jasper JPEG2000 driver that was used. Well it is
> > known not
> > to be very robust, so I'm not surprised that it fails decoding your
> > image.
> > 
> > 
> > Yes, upload it somewhere and provide the link.


More information about the gdal-dev mailing list