image-tiff icon indicating copy to clipboard operation
image-tiff copied to clipboard

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

Open mauricefisher64 opened this issue 2 years ago • 2 comments

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

mauricefisher64 avatar Sep 19 '22 21:09 mauricefisher64

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<()>

HeroicKatora avatar Sep 20 '22 06:09 HeroicKatora

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

mauricefisher64 avatar Sep 20 '22 13:09 mauricefisher64