remvee / exifr

EXIF Reader
https://remvee.github.io/exifr/
MIT License
489 stars 65 forks source link

Fix for time_proc, methods like date_time should return time in UTC #28

Closed mshytikov closed 12 years ago

mshytikov commented 12 years ago

According to http://www.exif.org/Exif2-2.PDF UTC is not obligatory from the spec but this should help to avoid problem with time zones .

remvee commented 12 years ago

I don't agree, it will introduce more time zone problems because more than 90% of the camera's have their clock set to local time and users of this module will most likely have their computer setup in the same zone. Converting the timestamps of their photo's to UTC will introduce the extra zone offset.

But I do agree it's a nuisance. Ruby doesn't make it very easy to handle time zones well. ActiveSupport together with TZInfo do a nice job but I can't find a way to take advantage of that without depending on them.

A proper solution is to allow passing in tz information for mktime either via a thread local or an options map at JPEG and TIFF initialization and falling back to the current behaviour. That's a pull request I will consider.

2012/06/02 23:01, mshytikov:

According to http://www.exif.org/Exif2-2.PDF UTC is not obligatory from the spec but this should help to avoid problem with time zones .

You can merge this Pull Request by running:

git pull https://github.com/mshytikov/exifr master

Or you can view, comment on it, or merge it online at:

https://github.com/remvee/exifr/pull/28

-- Commit Summary --

  • fix for time_proc, time should be in UTC

-- File Changes --

M lib/exifr/tiff.rb (2) M tests/jpeg_test.rb (7)

-- Patch Links --

https://github.com/remvee/exifr/pull/28.patch https://github.com/remvee/exifr/pull/28.diff


Reply to this email directly or view it on GitHub: https://github.com/remvee/exifr/pull/28

remvee commented 10 years ago

See bbd6e8966ab31f7ecb863d5dacdf04d25e796eb2 for a solution.