<div dir="ltr">Hi Even,<div>Thanks for the help.</div><div>I was wondering if I could just get this byte range from the file, and save it as jpeg2000 (with .j2c or something like that) and have a valid jpeg2000?</div><div>My goal is to be able to extract the jpeg2000 without using gdal_translate in order to save time and resources (cpu, ram, ...), as for my understanding the gdal_translate will always recompress the image.</div><div><br></div><div>Thanks, </div><font color="#888888"><div>Tobby </div></font></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 26, 2023 at 1:09 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
if you open such an image with debug traces (CPL_DEBUG=ON), you'll see <br>
something like<br>
<br>
GDAL: GDALOpen(/vsisubfile/907_565,byte.ntf, this=....) succeeds as <br>
JP2OpenJPEG<br>
<br>
which means that the JPEG2000 file starts at byte 907 with a length of <br>
565 bytes.<br>
<br>
Programatically from C/C++ , you could use the GDALGetOpenDatasets() <br>
methods after having opening the NITF file, and look for /vsisubfile/ files<br>
<br>
Even<br>
<br>
Le 26/05/2023 à 08:57, Tobby Moalem a écrit :<br>
> Hi,<br>
> For my understanding the nitf file is used as container, where <br>
> compressed jpeg2000 can be saved inside the nitf file.<br>
> I wonder if there is a way to use gdal to extract the jpeg2000 part <br>
> and save it separately (with extension of .j2c or other jpeg2000 <br>
> extensions) ?<br>
><br>
> Thanks in advance,<br>
> Tobby<br>
><br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
-- <br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
My software is free, but my time generally not.<br>
<br>
</blockquote></div>