[Gdal-dev] Support for JPEG2000
Ming Su
mjiesu at gmail.com
Wed Dec 14 21:20:37 EST 2005
Hello all,
I tired to use gdal to create Jasper JPEG2000 from GeoTiff file. The Jasper
libraries has already been built into the gdal. The following is my code:
const char *pszFormatOut = "JPEG2000";
GDALDriver* poDriverOut;
poDriverOut = GetGDALDriverManager()->GetDriverByName(pszFormatOut);
GDALDataset* poDstDS = poDriverOut->CreateCopy("Assessment.jp2",
poSrcDS, FALSE, papszOptions, NULL, NULL);
Note: poSrcDS is the data source from a valid Geotiff file.
The following is the error message I got:
ERROR 4: `Assessment.jp2' not recognised as a supported file format.
I stepped into the code and found it happed when tried to re-open dataset
and copy pam information. Inside this GDALOpen function( in
jpeg2000dataset.cpp ), I got the msg that is "Unable to read JP2 header
boxes", so the funtion return NULL.
Should I make the header box before copying the data? or shoud I use other
funtions instead of createcopy() to do it?
Thanks,
Mingjie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051214/16713259/attachment.html
More information about the Gdal-dev
mailing list