Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Null Terminator in Exif.Photo.DateTimeOriginal support. #18146

Closed
rexbron opened this issue Jan 4, 2025 · 6 comments · Fixed by #18169
Closed

Missing Null Terminator in Exif.Photo.DateTimeOriginal support. #18146

rexbron opened this issue Jan 4, 2025 · 6 comments · Fixed by #18169
Milestone

Comments

@rexbron
Copy link

rexbron commented Jan 4, 2025

Describe the bug

I am using AnalogEXIF to add meteadata to Film Lab scans. Setting a date in AnalogEXIF results in a 1/1/1 00:00 date in darktable 5.0.0 on Arm64. I think it may be related to #17393 and an out of spec EXIFtag with a missing rather than extra null terminator.

Sample files

I note that AnalogEXIF sets the Exif.Photo.DateTimeOriginal tag as 19 bytes long:

$ exiv2 -pa 06530009.JPG | grep Date
Exif.Image.DateTime                          Ascii      20  2024:03:18 16:20:44
Exif.Photo.DateTimeOriginal                  Ascii      19  2024:02:14 13:00:00
Exif.Photo.DateTimeDigitized                 Ascii      19  2024:03:18 14:00:00
Xmp.xmp.CreateDate                           XmpText    25  2024-03-18T15:45:24-04:00
Xmp.xmp.MetadataDate                         XmpText    25  2024-03-18T16:20:44-04:00
Xmp.xmp.ModifyDate                           XmpText    25  2024-03-18T16:20:44-04:00

Reencoding using MacOS's finder results in a longer tag and the date being interpreted correctly by darktable:

$ exiv2 -pa 06530009_resize.jpeg | grep Date
Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
Exif.Image.DateTime                          Ascii      20  2024:03:18 16:20:44
Exif.Photo.DateTimeOriginal                  Ascii      20  2024:02:14 13:00:00
Exif.Photo.DateTimeDigitized                 Ascii      20  2024:03:18 14:00:00

I'm sure the better solution is to have AnalogEXIF add the null terminator but the last release of that project was 2013 and it is abandoned (but still useful).

Steps to reproduce

  1. Use AnalogEXIF to add DateTimeOriginal
  2. Import into Darktable
  3. Note the date is not parsed

Expected behavior

Darktable should parse the malformed date.

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

downloaded from www.darktable.org

darktable version

5.0.0

What OS are you using?

Mac

What is the version of your OS?

14.7.1 (23H222)

Describe your system?

Macbook Pro M3 Pro.

Are you using OpenCL GPU in darktable?

I dont know

If yes, what is the GPU card and driver?

No response

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

@rexbron
Copy link
Author

rexbron commented Jan 5, 2025

@victoryforce As you authored the support for a longer than spec Exif.Photo.DateTimeOriginal, do you have thoughts on this?

@victoryforce
Copy link
Collaborator

@victoryforce As you authored the support for a longer than spec Exif.Photo.DateTimeOriginal, do you have thoughts on this?

I'll chek if exiv2 returns a null-terminated string in this case. If so (and I hope it does), then the fix is ​​trivial.

@victoryforce
Copy link
Collaborator

@rexbron Oh what a great shot, this is a view of the Toronto waterfront from Port Lands, as far as I can see?

@rexbron
Copy link
Author

rexbron commented Jan 6, 2025

Yes it is :) It's a new park under construction from winter 2024.

@victoryforce
Copy link
Collaborator

Yes it is :) It's a new park under construction from winter 2024.

I hope it will be built soon. I am thinking of visiting Toronto again after the war (my daughter worked here as an architect and I fell in love with the city).

@kmilos kmilos added this to the 5.0.1 milestone Jan 7, 2025
@victoryforce
Copy link
Collaborator

@rexbron Please check if the nightly build fixes this issue on your other files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants