RAW images not showing right timezone in Photos.app

Started by Grouaaah, September 13, 2023, 06:19:29 PM

Previous topic - Next topic

Grouaaah

Hello and thank you in advance for your help,

I think I understood how Photos.app works when it comes to sort the pictures depending on their Creation Date and Timezone for JPEG and common formats (jpg, png, etc.) but I struggle with RAW files now. I have 2 very similar pictures (I'm even wondering if they're not the same one, split in a separate RAW and JPEG file): I want to display the 2 pictures at the right place in Photos.app. With GraphicConverter and ExifTool I made the correct changes so the JPEG pic is displaying the timezone of the country: Santiago de Chile, UTC-04:00 (timezone stored in [ExifIFD] and [Composite] correctly). But the RAW file, even if it had the exact same metadata (as JPEG) stored in it, seems to not be sorted out correctly: the RAW file displays my computer's timezone (Paris, France).

Would you know how the RAW format works? Why it doesn't save at the right place, and how can I do? I tried to set the position of the picture manually in Photos to Santiago because sometimes Photos.app doesn't know where the picture was taken and may make a confusion between countries with same timezone, but it doesn't work here and Paris is different from Santiago.

I wonder if this is not something linked with the fact that a RAW picture has to be linked to a JPEG in Photos.app so the thumbnail displays: JPEG+RAW and uses JPEG metadata to sort it out correctly?

Or maybe I do not have to edit the metadata of a RAW files (this is why it is called a RAW file?) but if it is the case, how can I put my photo back into order?

I know it's possible in some way because I also have a vid with [Keys] and [Track] tags that is perfectly understood by Photos.app, but RAW really seems to be rude with me ???

And would you know how does this "fusion" system with RAW and JPEG works? I think it's when two files RAW+JPEG have the same name and date, but I'm not sure.

Thank you very much,

Regards

StarGeek

#1
What kind of RAW file?  If they are CR3 or HEIC (I think), then your commands may need adjustments, as these files are based upon the MP4 format, which stores time stamps differently from regular images.

Run this command on one and paste the output here
exiftool -time:all -G -a -s /path/to/files/
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Grouaaah

Hello,

Thank you for your answer, they are CR2 files

Grouaaah

#3
Desktop % exiftool -time:all -G -a -s .

======== ./20190702_164500.MOV (this one is showing up correctly)
[File]          FileModifyDate                  : 2019:07:02 22:45:00+02:00
[File]          FileAccessDate                  : 2023:09:13 23:29:02+02:00
[File]          FileInodeChangeDate             : 2023:09:13 23:21:57+02:00
[QuickTime]     CreateDate                      : 2019:07:02 20:45:00
[QuickTime]     ModifyDate                      : 2019:07:02 20:45:00
[QuickTime]     TrackCreateDate                 : 2019:07:02 20:45:00
[QuickTime]     TrackModifyDate                 : 2019:07:02 20:45:00
[QuickTime]     MediaCreateDate                 : 2019:07:02 20:45:00
[QuickTime]     MediaModifyDate                 : 2019:07:02 20:45:00
[QuickTime]     TrackCreateDate                 : 2019:07:02 20:45:00
[QuickTime]     TrackModifyDate                 : 2019:07:02 20:45:00
[QuickTime]     MediaCreateDate                 : 2019:07:02 20:45:00
[QuickTime]     MediaModifyDate                 : 2019:07:02 20:45:00
[QuickTime]     TrackCreateDate                 : 2019:07:02 20:45:00
[QuickTime]     TrackModifyDate                 : 2019:07:02 20:45:00
[QuickTime]     MediaCreateDate                 : 2019:07:02 20:45:00
[QuickTime]     MediaModifyDate                 : 2019:07:02 20:45:00
[XMP]           DateTimeOriginal                : 2019:07:02 16:45:00
[XMP]           CreateDate                      : 2019:07:02 16:45:00
[XMP]           ModifyDate                      : 2019:07:02 16:45:00
[QuickTime]     DateTimeOriginal                : 2019:07:02 16:45:00-04:00
[QuickTime]     CreationDate                    : 2019:07:02 16:45:00-04:00

======== ./20190702_164212.CR2 (this one is not)
[File]          FileModifyDate                  : 2019:07:02 16:42:12+02:00
[File]          FileAccessDate                  : 2023:09:13 23:32:27+02:00
[File]          FileInodeChangeDate             : 2023:09:13 23:28:16+02:00
[EXIF]          ModifyDate                      : 2019:07:02 16:42:12
[XMP]           DateTimeDigitized               : 2019:07:02 16:42:12
[XMP]           DateTimeOriginal                : 2019:07:02 16:42:12
[XMP]           DateCreated                     : 2019:07:02 16:42:12
[XMP]           CreateDate                      : 2019:07:02 16:42:12
[XMP]           ModifyDate                      : 2019:07:02 16:42:12
[EXIF]          DateTimeOriginal                : 2019:07:02 16:42:12
[EXIF]          CreateDate                      : 2019:07:02 16:42:12
[EXIF]          OffsetTime                      : -04:00
[EXIF]          OffsetTimeOriginal              : -04:00
[EXIF]          OffsetTimeDigitized             : -04:00
[EXIF]          SubSecTime                      : 06
[EXIF]          SubSecTimeOriginal              : 06
[EXIF]          SubSecTimeDigitized             : 06
[Composite]     SubSecCreateDate                : 2019:07:02 16:42:12.06-04:00
[Composite]     SubSecDateTimeOriginal          : 2019:07:02 16:42:12.06-04:00
[Composite]     SubSecModifyDate                : 2019:07:02 16:42:12.06-04:00

I noticed that if I rename the JPEG file as the RAW file, they fusion together in Photos.app, they're marked as "JPEG+RAW/RAW+JPEG" depending on the original one I set) and there is no timezone problem, it displays Santiago correctly (even if I set the RAW pic as original). Any idea why it does not show correct timezone when I click "edit date/time" in Photos on the RAW picture only?

(Oh, and the XMP tags were not initially present, I added them by myself when trying to run the "often miraculous" option on GraphicConverter: "Set all dates to the EXIF date", sorry if this is not the exact same name, my software is in French.)

StarGeek

The data looks correct, so it appears that the photo app isn't reading the time zones from the file.

I'd say first check to make sure there isn't an XMP sidecar file for the CR2, as that would normally get priority.  Also check to see if there's an update metadata or removed the files from the app and re-import them.

Otherwise, I'd update the XMP time stamps to be more complete by adding the subseconds and time zone.  You could to that with

exiftool '-DateTimeDigitized<SubSecCreateDate' '-DateTimeOriginal<SubSecDateTimeOriginal' '-DateCreated<SubSecCreateDate' '-CreateDate<SubSecCreateDate' '-ModifyDate<SubSecModifyDate' /path/to/files/

But when it comes down to it, if all the data is correct and the app still isn't reading it correctly, you can't force it to what it doesn't do.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Grouaaah

#5
Hello,

Thank you for your answer, I did this and reimport the RAW pictures but it didn't work. I read that like for a MP4 format, the data is embedded in the [track?] to avoid data corruption and RAW format need this data to be read.

So, for anyone who would have the same problem, to solve this, I clicked on "extract JPEG from RAW" in GraphicConverter which gave me a JPEG sample of the picture, and I imported both pictures so the RAW merges with the JPEG in Photos.app and is correctly displayed.

regards

wywh

#6
Quote from: Grouaaah on September 13, 2023, 06:19:29 PMI think I understood how Photos.app works

Images and RAWs and movies and dates and timezones and locations and apps, Oh My!

I briefly tried to re-construct your setup but soon gave up because there are so many moving parts :-/

I keep raw (.cr2, somewhat different cr3, .mp4 etc) and derived delivery format images and movies (.jpg, .mp4, .m4v, .mov etc) separate, and only import the latter to Photos.app. And archive selected RAW to external disks.

macOS 13 Ventura Photos.app seems treat .cr2 as an invisible sidecar to the derived same name .jpg when I import them. Photos can post-process such .cr2 or export both as originals.

I recently did a more simple test with images and movies with and without timezones, locations or any internal metadata dates:

https://discussions.apple.com/thread/254826789

p.s. macOS 13 Ventura no longer has GUI system setting to show timezone in Photos.app. But you can add it with:

defaults write NSGlobalDomain AppleICUTimeFormatStrings -dict-add "2" "HH:mm:ss z"

Photos.app shows timezone when it is launched. '-g' and '-globalDomain' may be used as synonyms for 'NSGlobalDomain'.

Reset to the default:

defaults delete NSGlobalDomain AppleICUTimeFormatStrings

- Matti

Grouaaah

#7
Thank you so much for your answers, y'all! It helped me a lot!!!

Wish I had this command for displaying the timezone in Photos earlier, it's soo useful! May I ask where have you learn about the existence of such a command? Did you datamine something, or do you work on Photos.app? I've never found anything about this.

About my setup, I didn't imagine you would find this so complex! It's only Photos.app for storing and sorting everything (I like keeping less important pictures like fun pics, in folders, but 95% of my life's pictures are in Photos.app) and I use GraphicConverter as my main tool, because since I discovered this incredibly powerful software last year, I revived. It saved my life for sorting, editing metadata, renaming, browsing more than 6,000 pics over years of travels. It's very ergonomic, quick, reliable and easy to handle (at some point). And it uses ExifTool! (Thanks to Phil Harvey for creating this fantastic one too!) I like using GC12 because it is very convenient and offers a visual, pleasant way to work, exiftool can be discouraging when it comes to the edition of tons of images at once (and to see the results quickly).

Anyway, I read your article Matti, thank you very much for this tip about the priority list for Photos.app. I think it's a must-have when you use the app for keeping all your pictures safe.

To go back to the original topic, even after passing all the commands, when I import only the RAW pic into Photos, strangely, the timezone is still Paris France (although every visible tag is set to UTC-04:00!!), this is weird. It adjusts correctly only if there is a JPG with it. But I got other RAW pics that have a very precise timezone: a name of a city near the place I took the pictures, BUT my EOS600D did not have any GPS embedded, so I'm still wondering how such a thing is possible!!?

And for the picture I took in Chile without setting the camera to the right Date/Time, it's stuck forever on Paris France.
Maybe RAW is a protected format that cannot be edited so easily after shot?


Which brings me to a very last question: sometimes, pictures are taken in France without any timezone (old cameras, etc.) and displays correctly in Photos.app because the computer is set to the same timezone as the one I want to see displayed, for instance Paris France. If I set my computer to another timezone, will Photos.app think the picture is not Paris France anymore?

Knowing this, would it be useful for me to put all the timezone stamps into the XMP tags with your command StarGeek, now that I know it doesn't change anything according to Photos.app?
Would it be relevant to apply this to my ~6,500 pictures in order to get all XMP stamps complete?


Thank you very much

Regards

wywh

I sometimes troubleshoot by 1st stripping ALL possible metadata, and then add very minimal only relevant tags one-by-one. I.e I do not add XMP, UserData, ItemList etc to movies because Photos.app does not read them or prioritizes Keys. I test .mp4, .m4v and .mov because sometimes they act differently (sigh). But I add them as the very last step with their own values so I can make sure that Photos.app does not grab info from them. For image captions I use both IPTC and XMP (like GC) but sometimes test only one of the other to see which one is preferred in some app.

To go back to the original topic, you are right: Photos.app reads .cr2 differently. It ignores .cr2 offset times (ExifIFD:OffsetTime*), prefers .jpg GPS timezones and prioritizes .jpg offset times. I did a simple test (without bringing other metadata or .cr3 to the mix...):

Photos.app does not read offset times from .cr2. But if I add GPS to .cr2, then Photos.app displays the .cr2 GPS timezone.

If there is .cr2 & .jpg pair with different offsets (and no GPS), Photos.app reads offset from the .jpg.

If there is .cr2 & .jpg pair with different GPS (and no offsets), Photos.app displays .jpg GPS timezone.

If there is .cr2 & .jpg pair with different offsets and different GPS, Photos.app displays .jpg offset.

> command for displaying the timezone in Photos

I learned it from this post:

https://discussions.apple.com/thread/254316210?answerId=258235462022#258235462022

Earlier macOS had a GUI system setting for this. Apple revised system settings GUI for macOS 13 Ventura and they are still half-baked in some areas. In the screenshot below Time Zone tag +02:00 was added to the Medium field. I hope macOS 14 Sonoma adds back old features.

In that Terminal command '2' seems to be the old Medium field that Photos.app displays so '3' does not work for this purpose. "HH:mm:ss zzzz" uses that more verbose time zone for some places but I prefer to keep them short with just "HH:mm:ss z".

Photos.app timezone custom_2.png

- Matti

Grouaaah

#9
Thank you very much for your detailed answer Matti, I take note of this.

So to conclude, I guess we can't know why my CR2 picture with UTC-04:00 is read as taken in "Paris France" since no information in the metadata suggests that the picture was UTC+02:00 (the actual timezone of Paris France). In your tests, I can see that the only thing Photos.app cares about CR2 is GPS. My picture doesn't contain any GPS timestamp so I don't understand why the other picture had a very precise city set (near the place the picture was taken) instead of a classic "Paris France", and on my picture taken in Chile with wrong timezone (I later edited to be correct), it is Paris France by default.

Even if there was no timezone in the mysterious tag that Photos.app prioritizes for sorting CR2 files, there would be no reason for my file to be set on Paris since there is no GPS info anywhere. The only way to know would be to try to change my computer's timezone, what I did: it changes nothing.
I personally noticed that changing the system timezone changes the timezone displayed by Photos.app only when the city has the same UTC number, for example: you import a picture taken in London with the timestamp in it but no GPS info. The picture may display a city in Africa. Once you've geotagged the photo in Photos.app, then London is displayed. Maybe there is a similar process with CR2?

Maybe CR2 have hidden tags GraphicConverter cannot read or show? Or CR2 files aren't fully editable in some way?

Regards

Grouaaah

#10
I think it is off-topic, but I would love to have a command to put all the geotagged info I put in Photos.app into the metadata of the images (I don't know if it is a good idea though) but it would save me a lot of time afterwards... I don't think such a command exist, as I guess Photos.app is storing all the additional info in other files, maybe a script can do this

wywh

#11
I did all tests on an otherwise empty new Photos library. Maybe some previously imported image still in the Photos trash can provoke unexpected results.

If the imported .cr3 has all possible metadata removed, Photos displays the computer timezone for it.

> My picture doesn't contain any GPS timestamp

I did not test GPS timestamps because I understood your .cr2 had no GPS locations and GPS timestamps (or did you mean "doesn't contain any GPS location"?). BTW, in iOS .jpg I have once experienced incorrect sorting in Photos obviously because for some images the iPhone managed to get GPS signal and GPS timestamp late compared to other devices. But newer iOS do not have GPS timestamp anymore and use those Offset times instead.

> put all the geotagged info I put in Photos.app into the metadata of the images

Do you mean how to join the metadata updated in Photos to images? If yes, it is possible to export originals with .xmp sidecars (that carry the updated info) and join them with GraphicConverter or exiftool. I.e. essentially the same as with Google Photos .json sidecars.

macOS 14 Sonoma is just around the corner so I leave further testing for that. Different Photos versions have used different algorithms when importing metadata. I usually re-import all images and movies to a new macOS version's Photos library so I know if some workflow needs fine-tuning or if some archive files miss essential metadata. Lately I spotted images with no metadata dates and images with "0.00" times even though it was correctly in 'ExifIFD:DateTimeOriginal' etc. I occasionally use exiftool to filter out such known errors in new files so I can fix them.

- Matti

Grouaaah

#12
Thank you very much for your answer Matti, you are right about the delay in the GPS before the use of OffSet, but I only noticed this on Samsung phones.
Quote from: wywh on September 17, 2023, 10:40:13 AMDo you mean how to join the metadata updated in Photos to images? If yes
Yes.
(For your possibly interfering deleted pictures in the library, I also noticed something like that one day. So I resetted everything and started from scratch. I'm wondering if the "Repair Library" option is really doing something into this, or not.)

I am now wondering if, instead of doing this through GraphicConverter, I could just use the regular "Export" function on Photos.app (not the "Export the original files..." but the regular Export button) because I've just noticed that this function, EXPORT, added the GPS info into the metadata of the picture (which is great, that was what I wanted!) BUT there is a downside to this:

When I don't know the exact location of a pic on Photos.app, I usually set the location on the nearest know place (for example the village near the forest, etc.) so I'm afraid that, if I do this, there would have a lot of confusions or inconsistencies in the reliability of the info in my full library. I mean that it is not very convenient to have a "probably close city near the location" instead of the exact coordinates of the picture (it bothers me a bit).

And moreover, the metadata is not exactly the same. Would you keep it "as is", for instance geotagged info into Photos.app and original metadata in most of the pictures? (and maybe later if I switch to another Photos application, export everything at that time?) — Or would you do export it all right now to be sure to save every GPS info in every picture?

Moreover, with the regular EXPORT option, okay we got the timezone stamps and the GPS stamps, but we lose the "Canon", "CanonCustom" and other original tags present in the picture. So we have a sufficient amount of tags in the picture for it to work properly in Photos.app but we lose some precious info. What do you think?

Thanks,

Kind regards

wywh

> just use the regular "Export" function on Photos.app

That nicely exports original (I have not tested if it drops any important camera data) + updated or added metadata done inside Photos. BUT I would not use it because it is slightly lossy regarding pixel data at least with exported .jpg (I try to avoid generation loss in pixel data and metadata). BTW I now noticed that macOS 13.6 Photos does not export updated Descriptions to .jpeg (for some reason it uses .jpeg instead .jpg), only to .tif or .png. I thought this old bug had been corrected but maybe it is here again...

I edit all metadata outside Photos and use it only as a viewer. But if I did any serious metadata edits in Photos, I'd use its "Export Unmodified Originals with .xmp sidecars" and join updated metadata in .xmp losslessly to the images and movies.

Notice that Photos uses nonstandard GPS references in its .xmp sidecars so western and southern references might very well be ignored unless .xmp is corrected or other workarounds used. GraphicConverter does a decent job with this (only movie XMP-exif GPS references are still incorrect but I have not nagged GC author about this anymore because my apps ignore XMP in movies anyway so I left that for Adobe users to complain about...) and exiftool can also work around this old issue.

https://exiftool.org/forum/index.php?topic=14943.msg80546#msg80546

Regarding GPS, I have a spreadsheet containing my often visited locations. I use GraphicConverter's Browser to paste GPS to images and movies missing GPS using that. Sometimes I also correct slightly incorrect GPS from mobile devices with that or copy GPS from Google Maps and paste with GraphicConverter.

Image and movie metadata inside the Photos library can be edited with some handy AppleScript commands or 3rd party tools. But I have my tested workflows using GraphicConverter and exiftool and my main archives are in plain folders with backups on external disks.

- Matti

Grouaaah

Quote from: wywh on September 26, 2023, 11:21:00 AMonly to .tif or .png
Really?? ...

Indeed, "EXPORT" seems to be an awful option.


Thank you Matti for all your tests. And thank you very much for the info on the pixel loss, I would never have noticed this by myself. I won't export all my library even if it is tempting or comfortable, I think you are right, would be better to merge it all in GC12.
Quote from: wywh on September 26, 2023, 11:21:00 AMedit all metadata outside Photos and use it only as a viewer. But if I did any serious metadata edits in Photos, I'd use its "Export Unmodified Originals with .xmp sidecars" and join updated metadata in .xmp losslessly to the images and movies
but I'm note sure I'd be able to do this today, I have to make some research before

I will think about a workflow to do this... maybe later. (For now, it does not represent any problem that the GPS isn't stored in the metadata — as not every picture has exact info —, same for the people faces, labels, tags, etc.) but if one day I decide to switch to another photo app, it could be very useful.

To be honest, it's a shame that there are so many bugs related to metadata management (especially at Apple which is supposed to be the reference) and that we have to work around problems ourselves, while it it's already complicated to understand how all this flow works without the bugs around it.

Simply having to manage images and movies separately, make multiple adjustments depending on file type, etc. is a hassle. I'm too discouraged to want to take the plunge. I will try to stay on Photos as long as possible with my ergonomic work configuration and my metadata as correct as possible, and leave this chore for later if I have to switch.

Maybe we could stay in contact in case we can help each other on this type of problems in the future, as we seem to have the same environment? Let me know, I don't know if this is allowed on this type of forums.

Anyway, thank you again for your info, your tests and your knowledge, take care!

Kind regards