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

BigOrangeSU

macrumors regular
Original poster
Dec 22, 2008
218
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
 
Last edited:
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

Is there a way to write a script to show which photos have the lower case .jpg vs .JPG?
 
I desperately need this, so I just paste that command into the terminal?

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
 
Is there a way to write a script to show which photos have the lower case .jpg vs .JPG?

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!
 
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!

Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.