On Friday, 26 May 2023 8:09:50 PM AEST Even Rouault wrote: > Hi, > > if you open such an image with debug traces (CPL_DEBUG=ON), you'll see > something like > > GDAL: GDALOpen(/vsisubfile/907_565,byte.ntf, this=....) succeeds as > JP2OpenJPEG > > which means that the JPEG2000 file starts at byte 907 with a length of > 565 bytes. > > Programatically from C/C++ , you could use the GDALGetOpenDatasets() > methods after having opening the NITF file, and look for /vsisubfile/ files
I would caution that this will give you the image segment (amongst other segments, possibly), which may not correspond directly to the JPEG 2000 codestream. In particular, if you have M8 compression, you may need to parse the image mask table off the front of that data. Also, depending on what the data is, the actual imagery may need to have LUT processing applied, etc. Brad _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev