Photos App Script To Show Duplicates

Discussion in 'Mac Apps and Mac App Store' started by BigOrangeSU, Apr 13, 2015.

  1. BigOrangeSU, Apr 13, 2015
    Last edited: Apr 13, 2015

    BigOrangeSU macrumors regular

    Dec 22, 2008
    When I imported my library of about 5k photos, I had an issue with duplicates were being created. Therefore I created a script which helps find the duplicates and prints them out to the stdout. There is a lot I could do to improve the script, such as show which the original and duplicate but I figured I would just share it anyways to help people. Let me know if you have any questions.

    You can ignore the photos that are in subdirectories of an already time folder. Typically the folder name will be a random string (perhaps another hash of some type)
  2. thewhitetower macrumors regular


    Jun 25, 2011
    Sorry...scriptnoob would I run this?

    Great work!
  3. hcole623 macrumors regular


    Oct 4, 2013
    I desperately need this, so I just paste that command into the terminal?
  4. ricosuave macrumors 6502


    Mar 27, 2007
    In front of my mac
    Is there a way to write a script to show which photos have the lower case .jpg vs .JPG?
  5. turnercl macrumors newbie

    Apr 5, 2008
    What I did:
    1) copy the source code and save as a text file named
    2) launch Terminal
    3) in the Terminal window type in 'python ' (but not those quote marks)
    then drag-drop the file into the Terminal window and key return.
    Drag-drop into the Terminal window puts the necessary file path in front of the file, e.g. for me that resulted in this:
    python /Volumes/Home0/Users/bubz/Desktop/Photo-dups/
  6. BigOrangeSU thread starter macrumors regular

    Dec 22, 2008
    its a different script, this script actually is opening the file and checking the signature of the contents, it has nothing to do with the name of the file. You can modify it to check:

    if "JPG" in os.path.join(subdir, file):
    print("upper case JPG detected in: " + os.path.join(subdir, file))

  7. ricosuave macrumors 6502


    Mar 27, 2007
    In front of my mac

Share This Page