Commit Graph

3 Commits

Author SHA1 Message Date
Su_Laus
30222c13d6 tif_dirwrite.c: bugfix DoubleToSrational(), which returns plain signed interger values always as unsigned rationals.
Add a test into rational_precision2double.c for "-1.0" and some editorials in tif_dirwrite.c.
(code is related to 6df997c786 changes).
2020-02-29 17:59:59 +01:00
Even Rouault
721120d0d7
rational_precision2double.c: fix many warnings, and do not build it on CMake on shared lib builds 2020-02-27 22:00:41 +01:00
Su_Laus
6df997c786 Rational with Double Precision Upgrade
Unfortunately, custom rational tags (TIFF_RATIONAL with field_bit=FIELD_CUSTOM) are defined as TIFF_SETGET_DOUBLE
but for the reading interface and LibTiff internally they are stored ALLWAYS as floating point SINGLE precision.
Double precision custom rational tags are not supported by LibTiff.

For the GPS tags in WGS84 a higher accuracy / precision is needed.
Therefore, this upgrade is made, keeping the old interface for the already defined tags and allowing a double precision definition,
as well as calculating rationals with higher accuracy / precision.
This higher accuracy can be used for newly defined tags like that in EXIF/GPS.

Refer also to the very old Bugzilla issue 2542 (#69)

A test file rational_precision2double.c is added, which shows prevention of the old interface to the already defined custom rational tags
with the standard library as well as with the upgraded library.

Also TIFFTAG_XRESOLUTION, TIFFTAG_YRESOLUTION, TIFFTAG_XPOSITION, TIFFTAG_YPOSITION amended from TIFF_SETGET_DOUBLE to TIFF_SETGET_FLOAT and testcase inserted in rational_precision2double.c
2020-02-27 21:11:20 +01:00