<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div style="font-family:Arial;"><br></div><div>On Sat, Sep 7, 2024, at 17:49, Even Rouault via gdal-dev wrote:<br></div><blockquote type="cite" id="qt" style=""><div>It could be argued that coding it in C wouldn't be the best
idea. I've spotted a TIFF Rust library
(<a class="qt-moz-txt-link-freetext" href="https://github.com/image-rs/image-tiff">https://github.com/image-rs/image-tiff</a>) but it is functionally
limited (at least in terms of supported codecs. didn't check
thourougly) and also associates the TIFF "object" with a file
reader with read+seek capabilities, and thus methods like
read_chunk()
(<a class="qt-moz-txt-link-freetext" href="https://github.com/image-rs/image-tiff/blob/6dc7a266d30291db1e706c8133357931f9e2a053/src/decoder/mod.rs#L1012">https://github.com/image-rs/image-tiff/blob/6dc7a266d30291db1e706c8133357931f9e2a053/src/decoder/mod.rs#L1012</a>)
take a mutable self reference, making it incompatible of
thread-safety.<br></div></blockquote><div style="font-family:Arial;">I think there are two aspects to this:<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;"> - few image Rust libraries are going to be as battle-hardened as libtiff. People just started working on competing implementations because they had a need or they wanted to, but didn't implement any advanced features, or they moved on to other projects. I think tiff, for example, doesn't support writing tiled images [1]. The API is just what happened to be required, but it can still change, more easily than that of libtiff [2]<br></div><div style="font-family:Arial;"> - however, the decoder is generic over the input stream, so it can be used even today with a pread/mmap wrapper over a reference-counted file handle (you could point multiple decoders to the same file)<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Laurentiu<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">[1] <a href="https://github.com/image-rs/image-tiff/issues/205">https://github.com/image-rs/image-tiff/issues/205</a><br></div><div style="font-family:Arial;">[2] the Rust community is more tolerant of breaking changes because the tooling makes them less of a problem<br></div><div style="font-family:Arial;">[3] <a href="https://docs.rs/tiff/latest/tiff/decoder/struct.Decoder.html">https://docs.rs/tiff/latest/tiff/decoder/struct.Decoder.html</a><br></div></body></html>