Author Topic: New Timezone Update  (Read 3318 times)

Offline wazrob

  • Newcomer
  • *
  • Posts: 40
    • View Profile
New Timezone Update
« on: March 19, 2015, 01:33:07 AM »
Kirk,

I have just returned from an overseas trip travelling through 5 timezones.  I ingested my photos on a daily basis with the correct timezone on my cameras and laptop, therefore all of my photos have the correct timezone.

Now back home if I change the time on any of my Sony photos using Adjust Capture Dates and Times, the following happens:

1. If using PMDebug.text with ALWAYS_WRITE_TIME_ZONE ON, changing the time will reset the XMP-photoshop:DateCreated and IPTC DateCreated timezones to the computer's current timezone.

2. If using PMDebug.text with ALWAYS_WRITE_TIME_ZONE OFF, changing the time will remove the timezone from XMP-photoshop:DateCreated and set IPTC DateCreated timezone to the computer's current timezone.

This is causing me a great deal of time and effort to correct the timezone on changed Sony photos.

Can the timezone be set by the ingest and not touched when using the Adjust Capture Dates and Times?

From my point of view when using the Adjust Capture Dates and Times, if this does not allow you to enter a timezone you should not touch the timezone.

Windows 7, PM 5.0 build 16299

Regards,

Warren

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2523
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: New Timezone Update
« Reply #1 on: March 19, 2015, 05:11:12 AM »
Hi Warren,

I just tested this on my Mac and can confirm this behaviour and agree it is a bug. It probably is just an oversight in the code, so hopefully easy to fix.

In the meantime, instead of using PM, I suggest you have a look at the exiftool utility by Phil Harvey. It has extensive support for e.g., altering datetimes.
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 412
    • View Profile
    • Camera Bits, Inc.
Re: New Timezone Update
« Reply #2 on: March 25, 2015, 03:58:46 PM »
Warren,

First I am a bit confused about this.  You said your photos were all taken with the camera set to the correct time and time zone when taken, and your computer at the correct time zone when you did your daily ingest with your laptop.  So why is it that you need to adjust the capture times?

Second, much of PM's ability to handle time zone correctly relies upon PM being able to read the time zone info that is stored in the proprietary Exif maker note section of the raw or jpeg file.  There is no Exif standard for time zone (as a TIFF-based tag).  PM can read the maker note time zone info (including daylight savings flag) for recent Nikon and Canon cameras that are capable of writing this info.  But not for Sony (their maker note is very dependent on the exact model and therefore requires a lot of work).  Also, PM will not update the Nikon or Canon proprietary time zone data in the maker note (although I suspect the ExifTool can do this).

What I would like to have is a sample photo from the Sony camera before and after PM makes the time adjustment.  I'd also like to see an explanation of what the time zone is supposed to be and what the adjustment is that you are trying to make in the adjust capture times dialog, and the expected result.  As I mentioned, until there is an Exif standard for time zone, the adjust capture times tool cannot make this change, and even if it did you may still need to change the time (e.g. maybe someone changes the time in the camera instead of the time zone by accident when they travel and therefore they would potentially need to change both depending on whether or not changing the time zone would also change the time - typically these settings are made independently).

Hayo: you said you can reproduce this.  Is this from a Nikon photo?  And how did you reproduce?

I will take a quick look at the adjust capture times logic, but the best way for me to fix this (if possible given that we don't read Sony time zone info from their maker note) is to have a sample file and a way to reproduce the issue.

BTW regarding your previous posts about time zone:

1) As I think Kirk explained, the XMP spec doesn't say anything about how Adobe or anyone else should format their data.  That is the whole point of XMP (extensible metadata).  Adobe chose to use ISO 8601 for their photoshop:DateCreated field in XMP - a logical choice.  Kirk explained that the 8601 spec is very flexible and can be as simple as a year YYYY without a month, day, or time.  So not including a time zone is not a "going against the XMP standards" as you claim.  Try opening a photo into Photoshop (even the latest CC version), then make some adjustment, then do a save-as.  Do you see the time zone in Photoshop's own photoshop:DateCreated tag in the XMP of the Photoshop-saved file?  I don't.  I don't see either the correct time zone (+2 from Munich) or my local time zone (-8 for Oregon), but I do see the sub seconds (which if you argue that time zone is a requirement then you should argue that the sub seconds is also a requirement, but I disagree with the need to include either and apparently you forcefully remove the sub seconds).  So I would say that since this is Adobe Photoshop's own namespace and field (NOT an XMP "standard") and Photoshop itself doesn't write the time zone, even the local time zone, then perhaps that was Adobe's intention to not include this?  Maybe they agree with Hayo that if you don't know what the time zone is then it shouldn't be written (because to write the field means you are asserting that this is indeed the correct time zone).  Adobe probably decided not to bother with reading proprietary maker note data to retrieve the time zone (especially since this is a legal gray area regarding DMCA), but since the Exif standard DOES include a capture time sub seconds, then Adobe writes this out with their XMP photoshop:DateCreated field.  We made a similar change at Hayo's request to not write time zone if it isn't known, which you didn't like, and so for you we created the special PMDebug.txt flag to FORCE the local time zone to be written if we can't determine the time zone from the camera.  We used to default to local time zone and always write it out (although there was a bug introduced at some point causing the delta hours to be put into delta minutes).

2) The old IPTC-IIM specification REQUIRES that a time zone be written.  This is a very rigid specification.  The time tag must be exactly formatted to include +HHMM or -HHMM.  So PM has to put SOME value there, and the most logical choice (for a camera make that PM doesn't read the time zone like Sony) is to use the local computer's time zone.  The other choice would be to put 0000 but that can't be separated from a legitimate photo taken at GMT time zone.

3) Do you have some utility that automatically determines your geolocation based solely on date/time and time zone (and maybe City/Country)?  How accurate can that possibly be?  I thought you would point at a map or load a log file from a GPS tracking device and use our utility Import GPS Coordinates (which will ask you what the GMT offset is).

Please forward sample Sony JPEGs with the info I requested above and I'll delve into this further to see what we can do.  You can send this to me as a private message if you would like (but you'll need to provide a link to download your sample since the personal messages system does not allow sending of files.)

Regards,

--dennis
« Last Edit: March 25, 2015, 04:04:49 PM by Kirk Baker »

Offline wazrob

  • Newcomer
  • *
  • Posts: 40
    • View Profile
Re: New Timezone Update
« Reply #3 on: March 26, 2015, 12:06:25 AM »
Dennis,

In answer to your questions.

First:  I need to adjust the time NOT the time zone for the following reason.  Both my wife and myself have cameras.  We both take photos of the same places while travelling overseas.  When we are home we review our combined photos and may have to change a photo's time to place the photo into the correct sequence.  Note that I have changed the time on the photo that I have sent you by 1 minute.   

Second:  From my point of view and the method I use to manage my photos, the time zone should only be created when originally ingesting the photo, as the XMP time zone will be created during ingest.  When adjusting the date or time using the adjust capture times tool, as you cannot enter a time zone into this tool, the time zone should not be changed.

As you say "the adjust capture times tool cannot make this change".  I agree, if you cannot enter the time zone on the adjust capture times tool, the time zone should not be changed by this tool.

3):  I use a GPS tracking device (Garmin fenix Watch), and geotag my photos using GeoSetter, which I find easier to use than Photo Mechanic, as it adds Location, City, State and Country to the photos.  I therefore require that the time zone be correct.

I have attached 2 photos:
1. DSC00168-1Start Photo ingested in overseas.
2. DSC00168-2Change Photo changed at home using the adjust capture times tool to modify the time by 1 minute.

I have resized the photos to send, the metadata seems to be the same as the original photos.

Thanks,
Warren


[attachment deleted by admin]

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2523
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: New Timezone Update
« Reply #4 on: March 26, 2015, 05:03:04 AM »
Hi Dennis,

The issue is quite straightforward: when you use Tools|Adjust Capture Dates and Times…, PM replaces the timezone information in the dates with the local timezone instead of leaving them unaltered…

As a simple test I created a small jpg in Photoshop, edited the metadata in PM to set the country code to JPN, ran a script which updates the timezones to match the countrycode. This file is TST_ORG.jpg (attached). On a copy of that file, I then used PM to adjust the time by 1 hour. Result: the timezone reverted back from +09:00 (JPN) to +01:00 (local TZ). It shouldn't do this!

As a side note: PM does not adjust the XMP:XMP-xmp:CreateDate information, should it not do so too?

Code: [Select]
$ exiftool -G0:1 -DateCreated -TimeCreated -CreateDate TST_ORG.jpg TST.jpg
======== TST_ORG.jpg
[IPTC]          Date Created                    : 2015:03:26
[XMP:XMP-photoshop] Date Created                : 2015:03:26 12:35:37+09:00
[IPTC]          Time Created                    : 12:35:37+09:00
[XMP:XMP-xmp]   Create Date                     : 2015:03:26 12:35:37+09:00
======== TST.jpg
[IPTC]          Date Created                    : 2015:03:26
[XMP:XMP-photoshop] Date Created                : 2015:03:26 13:35:37+01:00
[IPTC]          Time Created                    : 13:35:37+01:00
[XMP:XMP-xmp]   Create Date                     : 2015:03:26 12:35:37+09:00
    2 image files read

I have attached both TST files.

If you need more info/testing, please let me know :)


PS. For a future release (PM6?), I think it would be nice if one could set/update the timezone in applicable dates too.

[attachment deleted by admin]
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 412
    • View Profile
    • Camera Bits, Inc.
Re: New Timezone Update
« Reply #5 on: March 26, 2015, 02:58:08 PM »
Warren,

Thanks for the reply.

First:  I need to adjust the time NOT the time zone for the following reason.  Both my wife and myself have cameras.  We both take photos of the same places while travelling overseas.  When we are home we review our combined photos and may have to change a photo's time to place the photo into the correct sequence.  Note that I have changed the time on the photo that I have sent you by 1 minute.   

Ah - makes sense.  My suggestion is to have both of you take a photo of the same clock including the second hand.  You don't have to take the photo at the same moment, just the same clock.  If your GPS shows the time then take a photo of that.  Then when you do the Adjust Capture Times you can select that photo for your set of photos and in the Adjust Absolute option dial in the time shown in the photo.  Then do the same for your wife's photos using her photo of the same clock and the time that she took the photo.

Second:  From my point of view and the method I use to manage my photos, the time zone should only be created when originally ingesting the photo, as the XMP time zone will be created during ingest.  When adjusting the date or time using the adjust capture times tool, as you cannot enter a time zone into this tool, the time zone should not be changed.

As you say "the adjust capture times tool cannot make this change".  I agree, if you cannot enter the time zone on the adjust capture times tool, the time zone should not be changed by this tool.

Yes absolutely.  This is a bug and I will be on it!

I may add the option to change the time zone in the adjust capture times tool for PM 6.  In general I don't like touching maker notes because who knows what may happen (e.g. some checksum goes bad and the whole lot is ignored).  But it would be an option, and possibly either also change the hour or just be an independent change.  However, if the camera doesn't have the time zone or PM doesn't recognize it, then this option wouldn't function.  Then there is the issue of daylight savings time (and unfortunately Nikon and Canon handle this differently).  It may just be too darn confusing or dangerous, but a thought.

Thanks for your help.

Regards,

--dennis

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 412
    • View Profile
    • Camera Bits, Inc.
Re: New Timezone Update
« Reply #6 on: March 26, 2015, 03:01:07 PM »
Thanks Hayo.

As a simple test I created a small jpg in Photoshop, edited the metadata in PM to set the country code to JPN, ran a script which updates the timezones to match the country code.

Obviously such a script wouldn't work very well here in the US or especially Russia.

But thanks for the specifics.

Best,

--dennis

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2523
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: New Timezone Update
« Reply #7 on: March 27, 2015, 02:18:41 AM »
I may add the option to change the time zone in the adjust capture times tool for PM 6.  In general I don't like touching maker notes because who knows what may happen (e.g. some checksum goes bad and the whole lot is ignored).  But it would be an option, and possibly either also change the hour or just be an independent change.  However, if the camera doesn't have the time zone or PM doesn't recognize it, then this option wouldn't function.  Then there is the issue of daylight savings time (and unfortunately Nikon and Canon handle this differently).  It may just be too darn confusing or dangerous, but a thought.

Hi Dennis,

Even though to my knowledge makernotes don't have checksums and this TZ / DST change could be done in-place, I can definitely see why you wouldn't want to change the makernotes (if people need to change these, there would always be exiftool).
That said, it would be great if there was going to be an option to change the timezone for those times in the metadata that have it.

Obviously such a script wouldn't work very well here in the US or especially Russia.

Ha, I'm ahead of you here: In those cases, the State is also taken into account (and if even that wouldn't be enough, I'll think of something else too, but I haven't yet come across those). Anyway for most cases, just the country is enough :)

As a side note: PM does not adjust the XMP:XMP-xmp:CreateDate information, should it not do so too?
When you fix the TZ issue, will you also make this change?

Cheers,
Hayo
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 412
    • View Profile
    • Camera Bits, Inc.
Re: New Timezone Update
« Reply #8 on: March 27, 2015, 04:01:44 PM »
Warren & Hayo,

Well this appears to be a problem that not many users will experience.

Warren, I suspect you had the special PMDebug.txt flag ALWAYS_WRITE_TIME_ZONE set to ON when you ingested the Sony photos (which if they do have time zone info, PM doesn't recognize).  This would write the time zone of your local computer at the time of ingest.  And since you ingested in the same time zone as where the photos were taken, then all is great.  Except for the fact that the actual capture date/time (DT) stored by PM from the Exif does NOT have a time zone.  When PM talks about capture DT, it is by default the Exif capture DT tags not the photoshop:DateCreated field.  (On a side note, it is not uncommon for the IPTC/XMP DateCreated field to be different than the camera's Exif capture DT either because the camera wasn't set correctly or there is a manual override for news purposes.)

So when you do the Adjust Capture DT command, PM adjusts the capture DT (from Exif, and which still does NOT have a time zone) by the desired delta (e.g. 1 minute), then updates the Exif tags.  And you probably told PM to also update the file's IPTC/XMP DT.  So what PM does is to write the capture DT as the new IPTC/XMP DT.  And since the capture DT doesn't have a time zone, then the IPTC/XMP DT loses its time zone.  That is the problem, and like I said it is unlikely many other PM users are experiencing it (either because they don't care about time zone so much or they did the adjust capture DT in the correct time zone and were also using the special ALWAYS_WRITE_TIME_ZONE set to ON).

The fix is to go ahead and use the adjusted capture DT to update the IPTC DT, but if the capture DT doesn't have time zone and the IPTC/XMP does, then leave that alone.  Same for sub seconds I suppose (although not likely for IPTC DT to have sub seconds and capture DT to not have sub seconds.  I think that is the intention here.

Working on it...

UPDATE: instead of adjusting your Sony photos to match your Nikon photos in sequence (which probably do have the time zone?), try adjusting your Nikon photos to match the time of the Sony photos. :)

--dennis
« Last Edit: March 27, 2015, 05:11:38 PM by dennis »

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 412
    • View Profile
    • Camera Bits, Inc.
Re: New Timezone Update
« Reply #9 on: March 30, 2015, 06:01:53 PM »
OK this issue has been fixed and a build is in the testing process now.

If a photo has no time zone for its Exif capture date/time, but the IPTC/XMP fields photoshop:DateCreated or xmp:CreateDate contains time zone information, then when using the Adjust Capture Date and Times tool, the IPTC/XMP time zone will be maintained.  Per Hayo's request, we also now update the xmp:CreateDate field and use it as a backup if photoshop:DateCreated is unavailable.

Wheh!

--dennis