After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767537 - exiftag: Increase serialized geo coordinate precision
exiftag: Increase serialized geo coordinate precision
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.x
Other Linux
: Normal normal
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-11 15:41 UTC by Paulo Neves
Modified: 2016-06-13 06:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for the bug description (4.39 KB, patch)
2016-06-11 15:41 UTC, Paulo Neves
committed Details | Review

Description Paulo Neves 2016-06-11 15:41:59 UTC
Created attachment 329618 [details] [review]
Patch for the bug description

The serialization of double typed geographical
coordinates to DMS system supported by the exif
standards was previously truncated without need.

The previous code truncated the seconds part of
the coordinate to a fraction with denominator
equal to 1 causing a bug on the deserialization
when the test for the coordinate to be serialized
was more precise.

This patch applies a 10E6 multiplier to the numerator
equal to the denominator of the rational number.

Eg. Latitude = 89.5688643 Serialization

DMS Old code = 89/1 deg, 34/1 min, 7/1 sec
DMS New code = 89/1 deg, 34/1 min, 79114800UL/10000000UL

Deserialization

DMS Old code = 89.5686111111
DMS New code = 89.5688643

The new test tries to serialize a higher precision
coordinate.

The types of the coordinates are also guint32 instead
of gint like previously. guint32 is the type of the
fraction components in the exif.
Comment 1 Sebastian Dröge (slomo) 2016-06-13 06:31:01 UTC
commit 5dd720e064f6740fcf41afd706d10afe21048f12
Author: Paulo Neves <pneves@airborneprojects.com>
Date:   Sat Jun 11 17:11:30 2016 +0200

    exiftag: Increase serialized geo precision
    
    The serialization of double typed geographical
    coordinates to DMS system supported by the exif
    standards was previously truncated without need.
    
    The previous code truncated the seconds part of
    the coordinate to a fraction with denominator
    equal to 1 causing a bug on the deserialization
    when the test for the coordinate to be serialized
    was more precise.
    
    This patch applies a 10E6 multiplier to the numerator
    equal to the denominator of the rational number.
    
    Eg. Latitude = 89.5688643 Serialization
    
    DMS Old code = 89/1 deg, 34/1 min, 7/1 sec
    DMS New code = 89/1 deg, 34/1 min, 79114800UL/10000000UL
    
    Deserialization
    
    DMS Old code = 89.5686111111
    DMS New code = 89.5688643
    
    The new test tries to serialize a higher precision
    coordinate.
    
    The types of the coordinates are also guint32 instead
    of gint like previously. guint32 is the type of the
    fraction components in the exif.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767537