| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2012.06.18 13:15 "Re: Tiff Digest, Vol 97, Issue 5", by Olivier PaquetOn Sun, Jun 17, 2012 at 3:47 PM, He Yang <he-yang@live.com> wrote: > I am trying to set the EXIFTAG_EXPOSURETIME, which is a > TIFF_RATIONAL, is there are way to make sure the forward /backward > conversion are always consistent. Does libtiff provide a way to make > sure the rational to float and float to rational, But from my tracing, > I found the precision was lost during read back from the disk file not > from the memory? Not that I know as libtiff stores these as floats (or doubles, I'm not sure) internally and uses a basic conversion method in TIFFWriteDirectoryTagCheckedRational() to write them out as rationals. I think this is where the precision is lost. However, that function could certainly be improved to handle the "1 / x" case with better accuracy as it currently writes out all values < 1 as "x / UINT_MAX". It should be possible to also try "1 / x" and pick the representation with the lowest error. Can you compile your own libtiff to try it if I find some time to write this? Olivier |
|||||||