Hello all,<br>
<br>
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:<br>
<br>
const char *pszFormatOut = "JPEG2000";<br>
GDALDriver* poDriverOut;<br>
poDriverOut = GetGDALDriverManager()->GetDriverByName(pszFormatOut);<br>
<div id="mb_0">
GDALDataset* poDstDS =
poDriverOut->CreateCopy("Assessment.jp2", poSrcDS, FALSE,
papszOptions, NULL, NULL);<br>
<br>
Note: poSrcDS is the data source from a valid Geotiff file.<br>
<br>
The following is the error message I got:<br>
<br>
ERROR 4: `Assessment.jp2' not recognised as a supported file format.<br>
<br>
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.<br>
<br>
<span class="sg">Should I make the header box before copying the data? or shoud I use other funtions instead of createcopy() to do it?<br>
<br>
Thanks,<br>
<br>
Mingjie<br>
</span></div>