[gdal-dev] Idea: support JP2 TLM as sidecar in GDAL/OpenJPEG

Jérémy Anger angerj.dev at gmail.com
Wed Dec 18 09:16:06 PST 2024


> So you would have a XML file that would point
> to the beginning of the .jp2 file, then an auxiliary file with the TLM
> marker, and then the rest of the .jp2 file, and then you open
> /vsisparse/my_patched_jp2.xml . I believe that should work because there
> are no absolute offsets in JP2 files.

Thank you for the idea, indeed this works great, the implementation is
straightforward, and it doesn't require any change on GDAL/OpenJPEG!
So let's discard the tlm sidecar idea.

Le ven. 13 déc. 2024 à 17:47, Even Rouault <even.rouault at spatialys.com> a
écrit :

>
> >
> > If you are not against the .tlm sidecar idea in GDAL/OpenJPEG, that's
> > good enough for me for now, and it might allow further discussions
> > with ESA.
>
> Well, you should tell them I'm actively *against* the sidecar idea to
> motivate them doing the proper thing, otherwise they'll have little
> incentive to move :-)
>
> I just said it can be technically done (what can't ?), not that I'm a
> big fan of it. That would be purely a openjpeg change.
>
> Actually, if you only target GDAL, you could do something that requires
> no change neither in GDAL or openjpeg, which would be a variation of
> rewriting a new .jp2 file with the TLM marker without actually rewriting
> them. GDAL has a rather little-known /vsisparse/ virtual file system (Cf
>
> https://gdal.org/en/stable/user/virtual_file_systems.html#vsisparse-sparse-files)
>
> where you can point at a XML file that concatenates portions of various
> files into a virtual file. So you would have a XML file that would point
> to the beginning of the .jp2 file, then an auxiliary file with the TLM
> marker, and then the rest of the .jp2 file, and then you open
> /vsisparse/my_patched_jp2.xml . I believe that should work because there
> are no absolute offsets in JP2 files.
>
> --
> http://www.spatialys.com
> My software is free, but my time generally not.
> Butcher of all kinds of standards, open or closed formats. At the end,
> this is just about bytes.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241218/f63205bc/attachment.htm>


More information about the gdal-dev mailing list