Is there a way to get a manifest or listing of all file names from Apple Photos without having to download\export them all?

I have a few thousand photos that are duplicated by file name but with a different extension. eg jpg -> jpeg. The catch is that the duplicates don't have any EXIF data. I've sampled the file names and when I search in the apple photos UI they show up (eg. they exist) they have metadata, etc.

I've tried exporting the photos and importing again to see if photos would pick up that they are duplicates. Photos did not pick up on that. I even tried it after completely renaming the photos from jpeg to jpg.

I think I can delete them, but I want to be sure. I think I need a way to get all of the file names in Apple Photos, if possible so I can cross-check if the duplicate files truly are duplicates or not.

  • Have you opened up your terminal and looked in cd ~/Pictures/Photos\ Library.photoslibrary/originals
    – jbrahy
    Apr 25, 2022 at 17:27

2 Answers 2


Since your duplicates don't have any EXIF data, would it help if you created a smart album of photos with Focal length-is-Empty (AND Aperture, ISO, Camera model, Shutter speed are empty) conditions?

If you know SQL and can be very, very careful: Right-click your Photos library (normally it's in the Pictures folder), and select Show Package Contents. From the Database folder, open the Photos.sqlite database with DBBrowser or similar, open the ADDITIONALASSETATTRIBUTES table, and sort the ZORIGINALFILENAME column in ascending or descending order. Copy the column and paste in a new Excel or whatever file. Do not modify the Photos.sqlite file in any way, otherwise your Photos library will be corrupted.

enter image description here

  • I do know SQL! I think reading from the backing sqlite DB could solve this for me. I'll try this out shortly and accept if so! Apr 25, 2022 at 18:27
  • Would you mind adding a tiny bit to you post? I'll accept... but, basically you need this script: SELECT ZORIGINALFILENAME FROM ZCLOUDMASTER INNER JOIN ZGENERICASSET ON ZCLOUDMASTER.Z_PK = ZGENERICASSET.ZMASTER; --limit 10; and then a command like this: sqlite3 -init ~/Downloads/test.sql "file:///Users/your-name-here/Pictures/Photos Library.photoslibrary/database/Photos.sqlite?mode=ro" .quit > ~/Downloads/photos.txt Apr 25, 2022 at 18:59
  • This post was helpful: alexwlchan.net/2021/10/original-photos-filename Apr 25, 2022 at 18:59
  • 1
    @javamonkey79 I omitted the query because tech-savvy readers can easily write it but this approach is risky for non-technical readers. BTW, ZGENERICASSET in Catalina became ZASSET in Big Sur and Monterey. For more on Photos on Mac, see appinitio.medium.com/…
    – MacEater
    Apr 26, 2022 at 4:25

If you end up wanting a tool that looks at all the metadata and intelligently picks the larger or HEIC or edited / unedited copy of the photos and also keeps your albums sane while it removes the duplicates, you want this tool.

You can iterate over all the files in the filesystem, use mdls or an exif tool to parse and catalog the attributes in addition to the file name which don’t need to be unique but unless you do the export, wipe the database and reload it, you’re still on the hook for managing the library database.

  • Thanks! That is worth considering for some of the duplication features. I think the other answer better fits my question, but +1 nonetheless! Apr 25, 2022 at 23:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .