hMatoba / piexifjs

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

GPSLatitude, GPSLongitude, GPSTimeStamp truncated. #40

Closed nextWorker closed 6 years ago

nextWorker commented 6 years ago

Hi, it seems to be there a problem with data from tags GPSLatitude, GPSLongitude and GPSTimeStamp. Image attached show the exif object submitted to insert method of library and how is it read by load method.

piexifjs_color

By specifics GPSLatitude (2), GPSLongitude (4) and GPSTimeStamp (7) fields expect 3 values. When i try to read them field are truncated: only 2 values of 3 are present.

Thanks!

hMatoba commented 6 years ago

http://piexifjs.readthedocs.io/en/latest/appendices.html#exif-data-in-piexifjs

hMatoba commented 6 years ago

https://github.com/hMatoba/piexifjs/issues/1

nextWorker commented 6 years ago

Thanks @hMatoba, through the posted examples now GPSLatitude and GPSLongitude works as expected. However, i still have problems with GPSTimeStamp.

I tried to insert timestamp as rational value like [1529070323601, 1] (i have tried also with 60 and 3600 for denominator) but piexif return Possible Unhandled Promise Rejection (id: 0): "\'pack\' error. I think this is due to size of timestamp value is too big for a LONG of 32 bit.

I did not find anything about it on documentation.

How can i find a solution? It is possible have some examples, please.

Thanks for all.

hMatoba commented 6 years ago

http://www.cipa.jp/std/documents/e/DC-008-2012_E.pdf See "GPSTimeStamp" section.

hMatoba commented 6 years ago

[[12, 1], [59, 1], [10101, 1000]] 12:59:10.101

nextWorker commented 6 years ago

Thanks @hMatoba, everything works now!