Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JamesMay82

macrumors 65816
Oct 12, 2009
1,243
995
I use Photo Mechanic if I really need to go deep on metadata. It might be too complex and/or expensive for this particular use case since you'll only use it once. But...I'm curious what you mean when you say that Lr uses the wrong metadata? Is it because the metadata itself is wrong going in or because Lr uses attributes you don't want it to? If the latter, I'm genuinely curious about a little more detail on that point. In other words, can you describe a bit more on the outcome you're trying to get to?
Basically over the years I've used various photo apps from iPhoto, photos to Lightroom and I think from moving my photos to the various platforms it has changed the creation/capture dates in my photos.

At the moment I've just signed up again for Lightroom (cloud Version) and I've imported all my photos in but there are a few thousand with the wrong dates. As an example, My wedding from 2010 is labeled as April 2023 and there are many instances where this has happened. I've changed the date in Lightroom to the correct date which corrects them in Lightroom itself but it doesn't move the files into the correct date on the hard drive I've selected for Local storage of the images and this is driving me crazy because while I'm happy to use Lightroom, I ultimately want to have all my images preserved in date order in finder as my primary archive of the photos.

I've been searching all over google and tried loads of different apps and I can't find one to change the metadata correctly.

Would you still recommend Photo Mechanic for my needs? or do you have any other ideas?
 

r.harris1

macrumors 68020
Feb 20, 2012
2,190
12,628
Denver, Colorado, USA
Basically over the years I've used various photo apps from iPhoto, photos to Lightroom and I think from moving my photos to the various platforms it has changed the creation/capture dates in my photos.

At the moment I've just signed up again for Lightroom (cloud Version) and I've imported all my photos in but there are a few thousand with the wrong dates. As an example, My wedding from 2010 is labeled as April 2023 and there are many instances where this has happened. I've changed the date in Lightroom to the correct date which corrects them in Lightroom itself but it doesn't move the files into the correct date on the hard drive I've selected for Local storage of the images and this is driving me crazy because while I'm happy to use Lightroom, I ultimately want to have all my images preserved in date order in finder as my primary archive of the photos.

I've been searching all over google and tried loads of different apps and I can't find one to change the metadata correctly.

Would you still recommend Photo Mechanic for my needs? or do you have any other ideas?

Ah, got it (I think), so thank you for the clarification. I think a good step one is to figure out which date is getting used here. There are dates related to file create and then there's the original image create date. It sounds like the file create or file modify date is being used and what you want is that "original" date.

There are often numerous dates in image metadata, sometimes a surprising number, actually. I typically use exiftool at the command line to look at dates and other attributes but for a graphical tool, I use Exif Editor (that's the full name in the app store, developer is Martin Novak). It's handy for looking at stuff but less so for changing them.

Take a look at the Date/Time Original field to see if that's the correct date you're looking for for that particular image - hopefully it is. Ideally, no program will touch that. If it is, is this the date field you're using to catalog your data? Is it the right value?

If you are comfortable with exiftool at the command line and you have it installed (https://exiftool.org/install.html#MacOS) just open a terminal window, change directories to a desired image directory and type: exiftool <image name> | grep Date and hit enter. You'll get the relevant date fields to come up - make sure that "Date/Time Original" is the date you expect.

If the Date/Time Original is correct, and the images are stored on disk in some other date order (file create/modify or whatever), you're going to have to physically move them. Photo Mechanic can do this. Because you already have it, I expect Lr can too (I don't use it on a daily basis but others who do can chime in). I don't know if Lr Cloud has a different import mechanism as I've not used that variant of the program. You'd do an "import" from the "erroneous" directories to a new set of correct directories.
 

JamesMay82

macrumors 65816
Oct 12, 2009
1,243
995
Ah, got it (I think), so thank you for the clarification. I think a good step one is to figure out which date is getting used here. There are dates related to file create and then there's the original image create date. It sounds like the file create or file modify date is being used and what you want is that "original" date.

There are often numerous dates in image metadata, sometimes a surprising number, actually. I typically use exiftool at the command line to look at dates and other attributes but for a graphical tool, I use Exif Editor (that's the full name in the app store, developer is Martin Novak). It's handy for looking at stuff but less so for changing them.

Take a look at the Date/Time Original field to see if that's the correct date you're looking for for that particular image - hopefully it is. Ideally, no program will touch that. If it is, is this the date field you're using to catalog your data? Is it the right value?

If you are comfortable with exiftool at the command line and you have it installed (https://exiftool.org/install.html#MacOS) just open a terminal window, change directories to a desired image directory and type: exiftool <image name> | grep Date and hit enter. You'll get the relevant date fields to come up - make sure that "Date/Time Original" is the date you expect.

If the Date/Time Original is correct, and the images are stored on disk in some other date order (file create/modify or whatever), you're going to have to physically move them. Photo Mechanic can do this. Because you already have it, I expect Lr can too (I don't use it on a daily basis but others who do can chime in). I don't know if Lr Cloud has a different import mechanism as I've not used that variant of the program. You'd do an "import" from the "erroneous" directories to a new set of correct directories.
Thanks for taking the time to reply. I've tried the Martin Novak tool and it does show the date created/Original is April 2023 when they are actually from 2010 and other years. I'm guessing when I exported them from Apple photos its somehow managed to alter the dates.

The only work around I've figured so far is to change the dates in Lightroom like you suggested and then delete them off my local drive and then re download them from adobe Lightroom cloud. This seems to download them with the correct dates but it isn't perfect and still reverts some back to April 2023.

I think my only option at this point is to manually sort them in my finder folders and perhaps then rename the actual file name with the date if I can't change the metadata for finder. But then if a new photo software comes out or Apple or Lightroom have a corrupt library and I had to reply on the finder files then it would be importing everything again with the wrong dates. I know I;m massively overthinking things but I just want them to organised and done once so I don't need to think about it in the future.
 
  • Like
Reactions: r.harris1

RhetTbull

macrumors member
Apr 18, 2022
83
68
Los Angeles, CA
Thanks for taking the time to reply. I've tried the Martin Novak tool and it does show the date created/Original is April 2023 when they are actually from 2010 and other years. I'm guessing when I exported them from Apple photos its somehow managed to alter the dates.

The only work around I've figured so far is to change the dates in Lightroom like you suggested and then delete them off my local drive and then re download them from adobe Lightroom cloud. This seems to download them with the correct dates but it isn't perfect and still reverts some back to April 2023.

I think my only option at this point is to manually sort them in my finder folders and perhaps then rename the actual file name with the date if I can't change the metadata for finder. But then if a new photo software comes out or Apple or Lightroom have a corrupt library and I had to reply on the finder files then it would be importing everything again with the wrong dates. I know I;m massively overthinking things but I just want them to organised and done once so I don't need to think about it in the future.
Hi @entropi I'm the author of a free open source tool osxphotos that provides a number of utilities for working with Photos. Your issue sounded like an interesting problem that others might have so I wrote a script that uses osxphotos to match the photos from the Photos app and to the exported files and then apply metadata (such as the DateTimeCreated) and also optionally, update the Finder time for the file to match. If you still have the original Photos library you exported to Lightroom from, this might help you. It does involve a few steps in the Terminal.

1. Install osxphotos using these instructions
2. Install exiftool, a free utility for reading and writing metadata to/from files
3. Download the script from here and save it as `sync_photos_exif_to_files.py`
4. Run the script with `osxphotos run sync_photos_exif_to_files.py --help` to see the help options then run the script.

What the script does is search the path you've given it for files then loads the Photos database and attempts to match the files on disk with the originals in Photos. You can specify your own "key" to determine how to map between them. The default is called "fingerprint" which is a type of hash that Photos uses to uniquely identify files. You could also use filename or size or any combination of the three. fingerprint will probably work but if it's a Photos library that was upgraded over multiple versions of macOS, the fingerprint algorithm as changed and it's possible it won't match the files in which case "filename,size" might be a good alternative.

When the script finds a match, it writes metadata using exiftool to the file on disk (you can specify which metadata to write. If you want to only write the date/time from Photos, you'd use "datetime" for the metadata argument). If you pass the `--touch` option, the Finder date/time will also be updated to match the photo's metadata date/time.

Lastly, I recommend you run this with `--dry-run` first which will print out what the script will do but won't actually modify any files.

For example,

`osxphotos run sync_photos_exif_to_files.py datetime /path/to/Lightroom/files -r --touch --dry-run`

The `-r` specifies that the script should recursively look for files in the target directory. You can also just pass a list of files if you want to test on a small subset or pass a single directory without `-r`.
 
  • Love
Reactions: smithrh

smithrh

macrumors 68030
Feb 28, 2009
2,722
1,730
Hi @entropi I'm the author of a free open source tool osxphotos that provides a number of utilities for working with Photos. Your issue sounded like an interesting problem that others might have so I wrote a script that uses osxphotos to match the photos from the Photos app and to the exported files and then apply metadata (such as the DateTimeCreated) and also optionally, update the Finder time for the file to match. If you still have the original Photos library you exported to Lightroom from, this might help you. It does involve a few steps in the Terminal.

1. Install osxphotos using these instructions
2. Install exiftool, a free utility for reading and writing metadata to/from files
3. Download the script from here and save it as `sync_photos_exif_to_files.py`
4. Run the script with `osxphotos run sync_photos_exif_to_files.py --help` to see the help options then run the script.

What the script does is search the path you've given it for files then loads the Photos database and attempts to match the files on disk with the originals in Photos. You can specify your own "key" to determine how to map between them. The default is called "fingerprint" which is a type of hash that Photos uses to uniquely identify files. You could also use filename or size or any combination of the three. fingerprint will probably work but if it's a Photos library that was upgraded over multiple versions of macOS, the fingerprint algorithm as changed and it's possible it won't match the files in which case "filename,size" might be a good alternative.

When the script finds a match, it writes metadata using exiftool to the file on disk (you can specify which metadata to write. If you want to only write the date/time from Photos, you'd use "datetime" for the metadata argument). If you pass the `--touch` option, the Finder date/time will also be updated to match the photo's metadata date/time.

Lastly, I recommend you run this with `--dry-run` first which will print out what the script will do but won't actually modify any files.

For example,

`osxphotos run sync_photos_exif_to_files.py datetime /path/to/Lightroom/files -r --touch --dry-run`

The `-r` specifies that the script should recursively look for files in the target directory. You can also just pass a list of files if you want to test on a small subset or pass a single directory without `-r`.

osxphotos is an awesome piece of work!
 
  • Like
Reactions: RhetTbull

Tee.Wee

macrumors newbie
Nov 28, 2023
4
0
I took photos in RAW and imported them directly into Apple Photos. There, I added tags (locations, faces and keywords) and structured the files into folders. I also edited them with the Apple Photos extension/plugin from ON1.

So I have three types of meta data.
  1. The ones added by the camera.
  2. The ones I added in Apple photos. Locations, faces and keywords.
  3. The ones when I edited the photos with the Apple Photos extension from ON1.
Now, unfortunately, I'm trapped by Apple and I don't know how to solve the problem.

Because in the future I want to have all photos on my hard disk drive and synchronise them with Proton. I would like to keep them in manually organised folders on the hard disk drive and edit them from there with the standallone application from ON1.

How can I export the photos stored in Apple Photos with as many meta data as possible? The most important thing I care about is that I don't lose all the data from when I edited the photos with the extension/plugin. I already searched for sidecar files in the .photoslibrary-file. But I couldn't find any.

I'm not a developer. But I'm ready to learn if needed.
 

JamesMay82

macrumors 65816
Oct 12, 2009
1,243
995
I took photos in RAW and imported them directly into Apple Photos. There, I added tags (locations, faces and keywords) and structured the files into folders. I also edited them with the Apple Photos extension/plugin from ON1.

So I have three types of meta data.
  1. The ones added by the camera.
  2. The ones I added in Apple photos. Locations, faces and keywords.
  3. The ones when I edited the photos with the Apple Photos extension from ON1.
Now, unfortunately, I'm trapped by Apple and I don't know how to solve the problem.

Because in the future I want to have all photos on my hard disk drive and synchronise them with Proton. I would like to keep them in manually organised folders on the hard disk drive and edit them from there with the standallone application from ON1.

How can I export the photos stored in Apple Photos with as many meta data as possible? The most important thing I care about is that I don't lose all the data from when I edited the photos with the extension/plugin. I already searched for sidecar files in the .photoslibrary-file. But I couldn't find any.

I'm not a developer. But I'm ready to learn if needed.
I just wanted the dates to be correct for me And I never found a simple way to do it. Every time i exported it would change the meta data. I ended up using lightroom to change the meta data and then re download the images from lightroom and it seemed to keep the date information for me and organise them in a nice finder folder structure.

i now keep a apple photos library and a lightroom one. quite expensive now i come to think of it but gives me redundancy.
 

Tee.Wee

macrumors newbie
Nov 28, 2023
4
0
OSXphotos is what you want. See post #29 above.
Thanks, I will dig into, if that's the way to go.

@RhetTbull I learned that Apple Photos doesn't store edits in sidecar files. The edits made with Apple Photos on Mac are stored in the Apple Photos library's database. And not in separate .ON1 or other sidecar files.
So my next step will be to find out if OSXphotos takes that database into account.
 
Last edited:

RhetTbull

macrumors member
Apr 18, 2022
83
68
Los Angeles, CA
Thanks, I will dig into, if that's the way to go.

@RhetTbull I learned that Apple Photos doesn't store edits in sidecar files. The edits made with Apple Photos on Mac are stored in the Apple Photos library's database. And not in separate .ON1 or other sidecar files.
So my next step will be to find out if OSXphotos takes that database into account.
I don't use RAW photos so I cannot verify what Photos does with those. For certain edits done inside the Photos app, Photos stores these in a sidecar file (.AAE) which OSXPhotos can export. OSXPhotos also exports the rendered JPEG containing the edits. For RAW files edited outside of Photos, I have no idea what happens so so osxphotos does not do anything special. OSXPhotos does read the Photos database but this does not contain information on edits. OSXPhotos will export the original, the edited HEIC or JPEG, and optionally, the AAE file. OSXPhotos also provides programmatic access to the `.plist` files which also contain information on edits done in the Photos app via the python API but it does not currently export these.
 
  • Like
Reactions: harshar

Tee.Wee

macrumors newbie
Nov 28, 2023
4
0
Thanks for your response @RhetTbull - that is much appreciated 👊

You wrote 'edits done inside the Photos app, Photos stores these in a sidecar file (.AAE) which OSXPhotos can export.'.
  • Is the sidecar file (.AAE) generated when editing OR exporting? If when exporting, is the sidecar file generated based on the Apple Photos library's database?
  • If it is based on the Apple Photos library's database, then it might includes edits done with the Apple Photos extension/plugin from ON1.
Before I spend hours learning the code instead of spending time with my children, I want to raise the following question.

Is someone willing to provide me with the command that fulfils the following criteria?
In return, I am willing to make a donation! 🤝
  • Export all images and videos (the original, the edited HEIC or JPEG and the AAE file)
  • Keep original file name
  • Keep keywords
  • Keep places
  • Keep persons (faces)
  • Keep meta data from camera
  • Split to sub-/folders (existing in Apple Photos)
Many thanks for any feedback 😀
 

RhetTbull

macrumors member
Apr 18, 2022
83
68
Los Angeles, CA
> Is the sidecar file (.AAE) generated when editing OR exporting?

It is created by Photos when editing. Sometimes Photos creates a .plist sidecar instead. I don't know what triggers one or the other. osxphotos does not at this time export the .plist file as there's nothing you can do with it when exported.

> If it is based on the Apple Photos library's database, then it might includes edits done with the Apple Photos extension/plugin from ON1.

I don't know as I don't use ON1. You can experiment with editing a photo then exporting with osxphotos to see if your edits are preserved.

When you edit an image in Photos, the edits are stored in the AAE and/or plist file and a JPEG rendering of the image is created. osxphotos exports this rendered image. The data associated with the edits (light curves, crops, etc.) are stored in the AAE/plist but only Photos can use these. If you want to export the data about the edits with RAW files then osxphotos (and indeed, Photos) is the wrong tool. You should consider a digital asset management app like Lightroom.

> Before I spend hours learning the code instead of spending time with my children, I want to raise the following question.

I take offense to this. You're basically saying your time is more valuable than the time of others. I have spent over 1000 hours developing osxphotos and I give it away for free. It is very well documented and contains a detailed tutorial.

However, since I will give you the following command which will get you started:

osxphotos export /path/to/export --export-aae --sidecar xmp --directory "{folder_album}" --update

--export-aae = export the AAE files
--sidecar xmp = creates an XMP sidecar that contains all the metadata (keywords, faces, etc.)
--directory "{folder_album}" = use Folder/Album format for the export directory. If a photo is not in album it will be exported to the default folder "_" which you can change (read the tutorial)
--update = if you run the command again, only export new or updated / changed files

You may also want to look at `--exiftool` option which uses exiftool to write metadata such as faces, keywords to the exported image.
 

Tee.Wee

macrumors newbie
Nov 28, 2023
4
0
@RhetTbull please don't feel offended. I'm a user who doesn't use the Terminal often and I 'm not familiar with commands like this. If you need seconds to write, it can be multiple times for me.

I have now understood and applied it in a rudimentary way. Thank you very much!

I have two final questions.
  • How do I copy the value of person_in_image into the keywords when exporting with --exiftool?
  • How can I show appreciation for your work?
 

RhetTbull

macrumors member
Apr 18, 2022
83
68
Los Angeles, CA
@RhetTbull please don't feel offended. I'm a user who doesn't use the Terminal often and I 'm not familiar with commands like this. If you need seconds to write, it can be multiple times for me.

I have now understood and applied it in a rudimentary way. Thank you very much!

I have two final questions.
  • How do I copy the value of person_in_image into the keywords when exporting with --exiftool?
  • How can I show appreciation for your work?

Glad it worked.

> How do I copy the value of person_in_image into the keywords when exporting with --exiftool?

If you use the `--exiftool` option, the PersonInImage fields are automatically copied to the appropriate XMP tags in the file (XMP PersonInImage and XMP:Region*). You can also use `--person-keyword` to also use the person name as a keyword in which case the person's name would also get written to XMP:Subject, XMP:TagsList, IPTC:Keywords, etc.

> How can I show appreciation for your work?

Just say thank you! :) I've written this to help others and am happy to do so.
 
  • Love
  • Like
Reactions: katbel and Tee.Wee
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.