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>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char *pszFormatOut = &quot;JPEG2000&quot;;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALDriver* poDriverOut;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; poDriverOut = GetGDALDriverManager()-&gt;GetDriverByName(pszFormatOut);<br>
<div id="mb_0">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALDataset* poDstDS =
poDriverOut-&gt;CreateCopy(&quot;Assessment.jp2&quot;, poSrcDS, FALSE,
papszOptions, NULL, NULL);<br>
<br>
&nbsp; Note: poSrcDS is the data source from a valid Geotiff file.<br>
<br>
The following is the error message I got:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 &quot;Unable to read JP2 header
boxes&quot;, 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>