hMatoba / piexifjs

Read and modify exif in client-side or server-side JavaScript.
MIT License
571 stars 118 forks source link

fix negative gps coordinates pack error #53

Closed hlnlwj closed 6 years ago

hlnlwj commented 6 years ago

When testing the degToDmsRational and dmsRationalToDeg function with negative GPS coordinates, I stumbled upon an error : The DMS format isn't supposed to have negative values, resulting in an error when dumping the exif (inside the pack() call of the _dict_to_bytes() function)

To fix this I made sure to use the absolute value of the GPS coordinates inside the degToDmsRational function, and updated dmsRationalToDeg to comply with the changes.

hMatoba commented 6 years ago

Thanks!