Project

General

Profile

Feature #1231

Support for Canon TimeInfo makernote section

Added by Tobias E. about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
makernote
Target version:
Start date:
24 Sep 2016
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

Hello,

it would be great if you could add support for the TimeInfo section from Canon's makernotes. Maybe looking at exiftool will help as they support that already: http://search.cpan.org/dist/Image-ExifTool/lib/Image/ExifTool/TagNames.pod#Canon_TimeInfo_Tags

Thanks in advance and keep up the good work!


Files

canon-timeinfo.patch (8.48 KB) canon-timeinfo.patch Add support for the Canon TimeInfo MakerNote Ayke van Laethem, 01 Dec 2016 23:58
timeinfo_small.jpg (9.17 KB) timeinfo_small.jpg Ayke van Laethem, 03 Dec 2016 18:37
timeinfo_dst_small.jpg (9.05 KB) timeinfo_dst_small.jpg Ayke van Laethem, 03 Dec 2016 18:37

Associated revisions

Revision 4690 (diff)
Added by Robin Mills almost 5 years ago

#1231 Thank You to Ayke for providing the patch.

Revision 4692 (diff)
Added by Robin Mills almost 5 years ago

#1231 Added regression detector to test suite. Thanks very much to Ayke for providing the test data and the patch to implement the fix for #1231.

History

#1

Updated by Robin Mills about 5 years ago

  • Target version set to 0.28

Tobias

Thanks for this suggestion. If you have test files, please add them to this issue.

Both Raphael and Sridhar have recently joined the project and both are working on the Canon MakerNotes #1219 #1203. As I am very busy getting v0.26 ready to ship, I haven't been able to mentor them as fully as I intend. So this issue is unlikely to be dealt with until v0.27. I'm not going to assign the issue at this time to either as we will have a team meeting in October to discuss assignments and schedule for v0.27.

And, if you are interested, you are welcome to join the team and help with this and other issues.

#2

Updated by Tobias E. about 5 years ago

I would love to help out, but I am already quite busy hacking on darktable. :-)

You can find a raw file which contains a time zone of +2 hours (CEST) here – it's too big to be uploaded here: https://houz.org/tmp/6Q1B7117.CR2

#3

Updated by Robin Mills about 5 years ago

  • % Done changed from 0 to 10
  • Estimated time set to 10.00 h

Well if you ever want to leave the dark side, I have plenty of fun and interesting projects to amuse you here. No hacking in Exiv2, only good Software Engineering over here.

Thanks for the file (Baker Street, I see). I've copied your files to our test files on the build server. http://exiv2.dyndns.org:8080/userContent/testfiles/1231/

I've discovered that I have suitable test file. I recently wrote a script to pull down all of Phil's 7000 test files. And the CanonEOS files have this metadata.

910 rmills@rmillsmm:~/jenkins/testfiles/Phils/Canon $ for i in CanonEOS*.jpg ; do echo $i $(exiftool $i|grep 'Time Zone City'); done
CanonEOS-1D.jpg
CanonEOS-1DS.jpg
CanonEOS-1DSmkII.jpg
CanonEOS-1D_C.jpg Time Zone City : London
CanonEOS-1D_MarkIII.jpg
CanonEOS-1D_MarkII_N.jpg
CanonEOS-1D_MarkIV.jpg
CanonEOS-1D_X.jpg Time Zone City : Sydney
CanonEOS-1D_XMarkII.jpg Time Zone City : New York
CanonEOS-1DmkII.jpg
CanonEOS-1DmkIIN.jpg
CanonEOS-1DsMarkIII.jpg
CanonEOS1000D.jpg
CanonEOS100D.jpg Time Zone City : London
CanonEOS10D.jpg
CanonEOS1100D.jpg
CanonEOS1200D.jpg Time Zone City : London
CanonEOS1300D.jpg Time Zone City : Dubai
CanonEOS20D.jpg
CanonEOS20Da.jpg
CanonEOS300D.jpg
CanonEOS30D.jpg
CanonEOS350D.jpg
CanonEOS400D.jpg
CanonEOS40D.jpg
CanonEOS450D.jpg
CanonEOS500D.jpg
CanonEOS50D.jpg
CanonEOS550D.jpg
CanonEOS5D.jpg
CanonEOS5DS.jpg Time Zone City : Paris
CanonEOS5DS_R.jpg Time Zone City : London
CanonEOS5D_MarkII.jpg
CanonEOS5D_MarkIII.jpg Time Zone City : New York
CanonEOS5D_MarkIV.jpg Time Zone City : Tokyo
CanonEOS600D.jpg
CanonEOS60D.jpg
CanonEOS650D.jpg Time Zone City : Paris
CanonEOS6D.jpg Time Zone City : New York
CanonEOS700D.jpg Time Zone City : London
CanonEOS70D.jpg Time Zone City : Sao Paulo
CanonEOS750D.jpg Time Zone City : Tokyo
CanonEOS760D.jpg Time Zone City : London
CanonEOS7D.jpg
CanonEOS7D_MarkII.jpg Time Zone City : Paris
CanonEOS8000D.jpg Time Zone City : Tokyo
CanonEOS80D.jpg Time Zone City : New York
CanonEOS_D2000.jpg
CanonEOS_D30.jpg
CanonEOS_D60.jpg
CanonEOS_DIGITAL_REBEL.jpg
CanonEOS_DIGITAL_REBEL_XS.jpg
CanonEOS_DIGITAL_REBEL_XSi.jpg
CanonEOS_DIGITAL_REBEL_XT.jpg
CanonEOS_DIGITAL_REBEL_XTi.jpg
CanonEOS_K236.jpg
CanonEOS_KissDigital.jpg
CanonEOS_KissDigitalN.jpg
CanonEOS_KissDigitalX.jpg
CanonEOS_KissF.jpg
CanonEOS_KissX2.jpg
CanonEOS_KissX3.jpg
CanonEOS_KissX4.jpg
CanonEOS_KissX5.jpg
CanonEOS_KissX50.jpg
CanonEOS_KissX6i.jpg Time Zone City : London
CanonEOS_KissX7.jpg Time Zone City : Tokyo
CanonEOS_KissX70.jpg Time Zone City : Hong Kong
CanonEOS_KissX7i.jpg Time Zone City : London
CanonEOS_KissX8i.jpg Time Zone City : Tokyo
CanonEOS_M.jpg Time Zone City : Tokyo
CanonEOS_M10.jpg Time Zone City : (not set)
CanonEOS_M2.jpg Time Zone City : Bangkok
CanonEOS_M3.jpg Time Zone City : (not set)
CanonEOS_REBEL_SL1.jpg Time Zone City : New York
CanonEOS_REBEL_T1i.jpg
CanonEOS_REBEL_T2i.jpg
CanonEOS_REBEL_T3.jpg
CanonEOS_REBEL_T3i.jpg
CanonEOS_REBEL_T4i.jpg Time Zone City : Los Angeles
CanonEOS_REBEL_T5.jpg Time Zone City : New York
CanonEOS_REBEL_T5i.jpg Time Zone City : Los Angeles
CanonEOS_RebelT6.jpg Time Zone City : New York
CanonEOS_RebelT6i.jpg Time Zone City : New York
CanonEOS_RebelT6s.jpg Time Zone City : New York
911 rmills@rmillsmm:~/jenkins/testfiles/Phils/Canon $ 

#4

Updated by Ayke van Laethem almost 5 years ago

I have written a patch to support the TimeInfo field. It is attached here.

It is mostly based on the information in here:
http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html#TimeInfo

It works for the provided sample file, and for my own photos.
Example from the sample:

Exif.CanonTi.TimeZone                        SLong       1  120
Exif.CanonTi.TimeZoneCity SLong 1 Paris
Exif.CanonTi.DaylightSavings SLong 1 60

Example from a photo of mine:

Exif.CanonTi.TimeZone                        SLong       1  60
Exif.CanonTi.TimeZoneCity SLong 1 n/a
Exif.CanonTi.DaylightSavings SLong 1 0

Another example, now in DST (same timezone):

Exif.CanonTi.TimeZone                        SLong       1  120
Exif.CanonTi.TimeZoneCity SLong 1 n/a
Exif.CanonTi.DaylightSavings SLong 1 60

Time zone is apparently set in minutes, adding DST to it (e.g. now I'm living in UTC+1, last summer in UTC+2, which is 60 and 120 minutes respectively). I have not tested 'negative' time zones (to the west of UTC). Those should ideally be tested (I can do that if needed).

#5

Updated by Robin Mills almost 5 years ago

  • Status changed from New to Resolved
  • Assignee set to Robin Mills
  • Target version changed from 0.28 to 0.26
  • % Done changed from 10 to 80
  • Estimated time changed from 10.00 h to 3.00 h

Thank you, Ayke for providing the patch which I have submitted as r4690

Here's the output from current head of trunk:

509 rmills@rmillsmm:~/Jenkins/testfiles/1231 $ exiv2 -pa --grep time/i 6Q*tiff
Exif.Image.DateTime                          Ascii      20  2016:04:18 11:57:18
Exif.Photo.ExposureTime                      Rational    1  1/30 s
Exif.Photo.DateTimeOriginal                  Ascii      20  2016:04:18 11:57:18
Exif.Photo.DateTimeDigitized                 Ascii      20  2016:04:18 11:57:18
Exif.CanonCs.Selftimer                       Short       1  Off
Exif.Photo.SubSecTime                        Ascii       3  83
Exif.Photo.SubSecTimeOriginal                Ascii       3  83
Exif.Photo.SubSecTimeDigitized               Ascii       3  83
510 rmills@rmillsmm:~/Jenkins/testfiles/1231 $ 
And with your patch:
571 rmills@rmillsmbp:~ $ exiv2 -pa --grep time/i 6Q*tiff
Exif.Image.DateTime                          Ascii      20  2016:04:18 11:57:18
Exif.Photo.ExposureTime                      Rational    1  1/30 s
Exif.Photo.DateTimeOriginal                  Ascii      20  2016:04:18 11:57:18
Exif.Photo.DateTimeDigitized                 Ascii      20  2016:04:18 11:57:18
Exif.CanonCs.Selftimer                       Short       1  Off
Exif.CanonTi.TimeZone                        SLong       1  120
Exif.CanonTi.TimeZoneCity                    SLong       1  Paris
Exif.Photo.SubSecTime                        Ascii       3  83
Exif.Photo.SubSecTimeOriginal                Ascii       3  83
Exif.Photo.SubSecTimeDigitized               Ascii       3  83
572 rmills@rmillsmbp:~ $ 
So you have successfully added the CanonTi group and extracted the information correctly. The existing test harness runs successfully.

Remarkably, I'm visiting Andreas (the Exiv2 Founder) this weekend and I expect we'll review your patch together. I will submit an additional regression detector to the test suite to ensure that your fix doesn't get broken by future changes in Exiv2.

#6

Updated by Robin Mills almost 5 years ago

Ayke

Can you provide your test file please?

The file that Tobias provided has an Exif Tag > 64k bytes and so cannot be converted to a little .exv file. Tobias' file is 30mb and I don't want to add such a large file to the test suite stored in our repository.

I hope to resource a project in 2017 #992 to have a more extensive tests which will be executed periodically by our buildserver and the associated test files will not be stored in our repository. So Tobias' test file (and many others) will be used in future. However, for the moment, it would be good to use your file as a regression detector.

Robin

#7

Updated by Ayke van Laethem almost 5 years ago

Nice to see it land in exiv2 :)

I have attached two files to test, one with and one without DST set (using the current time which isn't DST, so technically incorrect but the camera doesn't care). Just to be sure, I tested those again.

The provided files are resized to 1x1 (using ImageMagick convert), and have the thumbnail removed (using exiftool). That brings them to ~9KB each. I can provide the original files as well (that are simply dark photos at the lowest possible resolution to keep the file size down, ~450KB).

#8

Updated by Robin Mills almost 5 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 80 to 100

Thanks very much for the test data. I've added your files r4692 as test/data/exiv2-bug1231{a|b}.jpg

Thank You very much for working on this and providing the patch and the test files. If you're ever looking for an unpaid job on an open-source project, I would be very happy to welcome you to Team Exiv2. Thank You for your contribution.

Also available in: Atom PDF