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

Even Rouault even.rouault at spatialys.com
Fri Dec 13 08:47:48 PST 2024


>
> 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.



More information about the gdal-dev mailing list