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

    Joined:
    Dec 22, 2008
    #1
    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)

    https://gist.github.com/BradRuderman/9c64ea7dd5956dadeb87
     
  2. thewhitetower macrumors member

    thewhitetower

    Joined:
    Jun 25, 2011
    #2
    Sorry...scriptnoob here....how would I run this?

    Great work!
     
  3. hcole623 macrumors regular

    hcole623

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

    ricosuave

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

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

    Joined:
    Dec 22, 2008
    #6
    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))

    Thanks!
     
  7. ricosuave macrumors 6502

    ricosuave

    Joined:
    Mar 27, 2007
    Location:
    In front of my mac
    #7
    Thanks
     

Share This Page