image-rs / image-tiff

TIFF decoding and encoding library in pure Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No way to pass RATIONS/SRATIONAL/IDF/IDF8 to write_tag

mauricefisher64 opened this issue · comments

DirectoryEncoder does not expose the types listed above so there is no way to call write_tag with entries for those types.

Oh, I see. The impls are provided for [Ifd], [Ifd8] while DirectoryEncoder::write_tag takes its argument by-value and thus has T: Sized bound that unexpectedly restricts the allowed types. A potential fix would change the method's signature to read

pub fn write_tag<T: TiffValue>(&mut self, tag: Tag, value: &T) -> TiffResult<()>

Also those structures are not publicly exposed so you cannot even pass them.