AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
June 2012

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2012.06.17 19:47 "Re: Tiff Digest, Vol 97, Issue 5", by He Yang
2012.06.18 13:15 "Re: Tiff Digest, Vol 97, Issue 5", by Olivier Paquet

2012.06.18 13:15 "Re: Tiff Digest, Vol 97, Issue 5", by Olivier Paquet

On 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