2020.02.10 23:23 "[Tiff] recommended way to support a different compression", by Kris Fedorenko
I am interested in adding support for a different compression scheme not currently supported by libtiff. As far as I could tell there are two possible ways to do this:
- Modifying libtiff to add *builtin* support for a new compression algorithm: http://www.simplesystems.org/libtiff/internals.html#AddingCODECS
- Using TIFFRegisterCODEC routine to register a codec during runtime to augment set of codecs available for an application: http://www.simplesystems.org/libtiff/man/TIFFcodec.3tiff.html
Is one method preferred over the other? The first method seems to be a bit better documented. But it looks like for *both* methods you would need to create a codec file that can be modeled after existing ones like tif_dumpmode.c (defining specific functions like TIFFInitMethod). Is this understanding accurate? Are there any known pitfalls for either of the methods, or any more documentation/examples available online? Anything else that would be important to know about them?
I would greatly appreciate your thoughts on this matter!