Photos in Photos.app to Files in Finder
What is the goal here? Photos are priceless, you cannot recreate some of the moments captured in photos… so why leave them up to a single cloud storage provider? I went all-in with iCloud Photo Library back in September of 2015. I have yet to have any issues with the app or service really, I just wanted to ensure I have the photos themselves backed up in the event Apple took down iCloud Photo Library or I wanted to try a different service. With that said, on with the show.
With anything related to photos, back up your data. Make a copy of your Photos Library.photoslibrary somewhere. Anywhere but your local disk. Don’t start this until you’ve done this.
Just for safety and my own anxiety related to photos, I actually made two (2) copies… but in the same spot, you’ll see why in just a moment.
Now, with that out of the way… I need to work on the actual photos from the library, so to do that, right click on the *.photoslibrary file and select “Show Package Contents”. Inside here, there will be a “Masters” folder. This is where your photos are. Make a copy of this next to where you have a copy of your photos library. Again, backing up your data is always a good thing.
side note: why have a backup of “Photos Library.photoslibrary” and then also of “Masters”? What happens if you mess something up in the “Masters” and need to go back to the library? Can’t really do that if you don’t have a backup. Always keep a clean backup before messing with your data.
OK, now that we have our “Masters” folder to work with. The biggest hurdle we have to deal with is that when you import photos into the library (assuming you have “Copy into Photos” turned on) is that at the time of import, they all go into a specific set of folders that don’t necessarily coincide with the date the photo was taken (e.g. the date found in the EXIF data of the photo). This is a problem for a lot of application that will sort files based on create date.
The first hurdle: setting “Date Created” as found in Finder to “Date Time Digitized” as found in Preview. The tool for the job: A Better Finder Attributes 5. This will obtain the EXIF date and allow you to set create date based on it. Once all your photos have been adjusted, this step is done.
The next hurdle: making sense of the folder hierarchy. The tool for the job: Hazel. What Hazel’s job is to monitor a folder for items within it based on rules you set. Put a different way, I set rules based on:
Date is after 2010-12-31 11:59pm
Date is before 2012-01-01 12:00am
Note: I set rules for each year where necessary, I had photos going back to 2008 — others may have only 2015-2016, your mileage may vary.
Now, whenever a photo with a date set anywhere in 2011 is present — Hazel takes action on it by:
Moving photo to “Photos” folder
Moving to sub-folder based on year (e.g. 2008) created
Moving to sub-folder based on month (e.g. 01) created
Moving to sub-folder based on day (e.g. 01) created
Note: why use numbers instead of words? When sorting by name in Finder, having them as numerals with leading 0s will make sure they’re in order. Sorting by name with words will be out of order “February” comes before “January” in the alphabet, but not on a calendar.
What I did that seemed to be useful is make a “temp” folder and set your rules to take action on this folder.
At this point I have a big job. Move each photo from the “Masters” sub-folders into “temp”. I’m sure there was a way I could have done this automatically on rules, but I didn’t want to deal with duplicate names showing up as many photos are named “IMG_XXXX.jpg” or similar. I opened each subfolder and highlighted all photos within it —> dragged to “temp” —> Hazel automatically takes action and gets them sorted. Does this for all the sub-folders in “Masters”.
Once this is all said and done, you’ll have a “Photos” folder with a sub-folder of the full year (2008, 2009, etc.), then sub-folders within each year for each calendar month (01, 02, etc.) you had photos, then sub-folders for each day (01, 02, etc.).
The one caveat to this entire thing is I’m assuming the date/time was set correctly on the camera that took the photo. If that’s not set correctly, the EXIF data will be incorrect. If the EXIF data is incorrect, then the first tool cannot do its job. If the first tool, well you get the picture. Pro tip: make sure your camera has the correct date/time before you take your pictures.
Now the only thing left for me to do is migrate the “Photos” folder into my backup. I’m using Kaleidoscope for this. It’s a really heavy handed tool for this… you could just as easily open “Get Info” on each folder and see where differences are and then figure it out. I have the app already, so I’m using it.