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

EXIF_HOUR variable get wrong time zone when importing #5802

Closed
mikaelstaldal opened this issue Jul 25, 2020 · 25 comments · Fixed by #5877
Closed

EXIF_HOUR variable get wrong time zone when importing #5802

mikaelstaldal opened this issue Jul 25, 2020 · 25 comments · Fixed by #5877

Comments

@mikaelstaldal
Copy link
Contributor

When I use the EXIF_HOUR variable in File Naming Pattern in Session Options, the filename after import from camera is one hour ahead of what I see in the Image Information panel in Darktable.

My main time zone is CET+1, but currently CEST+2 (daylight saving time). My camera is configured with this.

Platform (please complete the following information):

  • Darktable Version: 3.0.2
  • OS: Unbutu Linux 18.04
@phweyland
Copy link
Contributor

When I use the EXIF_HOUR variable in File Naming Pattern in Session Options, the filename after import from camera is one hour ahead of what I see in the Image Information panel in Darktable.

Do you see the same discrepancy in dt image information ?

I haven't found any exif summer time flag in exiv2 exif tags. So I assume the time delivered by the camera ("Exif.Image.DateTimeOriginal") should be the season corrected one.

@mikaelstaldal
Copy link
Contributor Author

Do you see the same discrepancy in dt image information ?

Not sure what your mean with dt image information, given that it should be different from the Image Information panel i Darktable.

@mikaelstaldal
Copy link
Contributor Author

The time shown in Image Information panel i Darktable is correct, but the EXIF_HOUR variable is wrong (one hour ahead for me).

I suspect that either time zone or DST is applied wrongly on EXIF_HOUR.

@phweyland
Copy link
Contributor

I've looked at the code. The source information for datetime in image information and for the variable $(EXIF_HOUR) is the same. I'm afraid I cannot explain the discrepancy you get.
Could you share the xmp of an image showing this defect ? I'll try to reproduce your issue.

@phweyland
Copy link
Contributor

I'm afraid I need the raw file too.
dt reads my raw image file datetime instead of exif:DateTimeOriginal="2020:08:02 13:50:54"
in your xmp, which is normal, sorry.
Would you mind to share a faulty raw file and the associated xmp ?

@phweyland
Copy link
Contributor

All good for me:

image

@mikaelstaldal mikaelstaldal changed the title EXIF_HOUR variable get wrong time zone EXIF_HOUR variable get wrong time zone when importing Aug 5, 2020
@mikaelstaldal
Copy link
Contributor Author

It is correct for me also when exporting. The problem occurs when importing.

@phweyland
Copy link
Contributor

It is correct for me also when exporting. The problem occurs when importing.

Ooops. Let me check again.

@phweyland
Copy link
Contributor

phweyland commented Aug 5, 2020

Sorry, I'm not used to rename files when importing.
I think the option only works when you import with EDIT "scan for devices" "import from camera". Is that correct ?
Then dt should follow the settings:
image
If it is still correct, what is the string you use ?

EDIT. Ok, I've reproduced the issue. I get 12 for $(EXIF_HOUR) in the imported name (instead of 13 as on the screenshot above).

@mikaelstaldal
Copy link
Contributor Author

So you get one hour less, I get one hour more. Most likely a time zone issue.

@phweyland
Copy link
Contributor

So you get one hour less, I get one hour more. Most likely a time zone issue.

Could you share the string you use to build the filename please ?

@phweyland
Copy link
Contributor

Ok, I've reproduced the issue. I get 12 for $(EXIF_HOUR) in the imported name (instead of 13 as on the screenshot above).

My mistake. it was not your file. with your file I get 13 too with that string:
$(EXIF_YEAR)$(EXIF_MONTH)$(EXIF_DAY)-$(EXIF_HOUR):$(EXIF_MINUTE):$(EXIF_SECOND)_$(SEQUENCE).$(FILE_EXTENSION)

Back to the correct behavior, isn't ?

image

@phweyland
Copy link
Contributor

Here is the result of exiv2 against your file.
All the datetime values are coherent (2020:08:02 13:50:54) and I don't see any time zone info.

20200802_145054.ARW.txt

@mikaelstaldal
Copy link
Contributor Author

I use this file naming pattern: $(EXIF_YEAR)$(EXIF_MONTH)$(EXIF_DAY)_$(EXIF_HOUR)$(EXIF_MINUTE)$(EXIF_SECOND).$(FILE_EXTENSION)

@mikaelstaldal
Copy link
Contributor Author

Yes, I use import from camera, from a "Mass Storage Camera".

@mikaelstaldal
Copy link
Contributor Author

Is your computer set to CEST time zone?

@phweyland
Copy link
Contributor

Is your computer set to CEST time zone?

Brazilia time zone

@mikaelstaldal
Copy link
Contributor Author

Do you have Daylight Savings Time? I do at the moment.

@phweyland
Copy link
Contributor

Do you have Daylight Savings Time?

No, winter time currently.
It is not normal that the current local time influences image taken time...
I'll try to find out this.

@phweyland
Copy link
Contributor

I've followed the full import process. the variable expansion is the same as for exportation.

Maybe there is a difference in the way to process this.
I've copied your arw file to one of my camera memory card and connected this memory card to my computer.
Then I use the "import from camera" entry, select the arw image and click on import.
In that process I don't see how the computer time zone could interfere.

Yes, I use import from camera, from a "Mass Storage Camera".

That's where I've a doubt. What is "Mass Storage Camera" ?

@mikaelstaldal
Copy link
Contributor Author

Darktable says "Mass Storage Camera" when I connect my camera. I guess it means that it doesn't recognize my particular camera model (and cannot do tethering), and access my camera as a generic USB storage (or maybe PTP/MTP, not sure).

@ptilopteri
Copy link

it means MPT rather than PTP

@phweyland
Copy link
Contributor

phweyland commented Aug 6, 2020

image

moving to ETC I get the issue on import time. export time still ok.
I think the guilty is sscanf(), used to decode the datetime, which may be locale dependent.
Other parts of code seem to use strftime().
Still some work to check that and ... not to create another issue.

@mikaelstaldal
Copy link
Contributor Author

I can confirm that this bug is fixed.

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