hMatoba / Piexif

Exif manipulation with pure python script.
MIT License
367 stars 81 forks source link

Bad GPS Location #115

Closed estribiyo closed 3 years ago

estribiyo commented 3 years ago

Trying to store these values in GPS fields 43.02774135168072, -8.811035156250002...

Trying Latitude and Longitude as tuple:

{
    0: (2, 3, 0, 0),
    1: b"N",
    2: ((43, 1), (1, 1), (2308208, 57895)),
    3: b"W",
    4: ((8, 1), (48, 1), (5085, 128)),
    5: b"1",
    6: (0, 1),
    7: ((20, 1), (3, 1), (50, 1)),
    12: b"K",
    13: (40, 1),
    18: "WGS-84",
    27: b"ASCII\x00\x00\x00MANUAL",
    29: b"2021:01:11",
}

I got this stored in jpeg file:

{
    0: (2, 3, 0, 0),
    1: b"N",
    2: ((43, 1), (1, 1), (66448, 1)),
    3: b"W",
    4: ((8, 1), (48, 1), (662, 1)),
    5: 49,
    6: (0, 1),
    7: ((20, 1), (3, 1), (50, 1)),
    12: b"K",
    13: (40, 1),
    18: b"WGS-84",
    27: b"ASCII\x00\x00\x00MANUAL",
    29: b"2021:01:11",
}

With same Latitude and Longitude as array:

    ...
    2: [(43, 1), (1, 1), (2308208, 57895)],
    ...
    4: [(8, 1), (48, 1), (5085, 128)],
    ...

I've got:

    ...
    2: ((43, 1), (1, 1), (66448, 1)),
    ...
    4: ((8, 1), (48, 1), (662, 1)),
    ...

Also I've tried to save it as [decimaldegree.numerator, decimaldegree.denominator]:

    ...
    2: [2329651, 54143],
    ...
    4: [18045, 2048],
    ...

Getting:

    ...
    2: ((43, 1), (1, 1), (66448, 1)),
    ...
    4: ((8, 1), (48, 1), (6621, 1)),
    ...

I've tried also to pass the values as Fraction and float... but no way to get the correct values stored...

How can I get the correct values stored?

estribiyo commented 3 years ago

Solved using py3exiv2