Is there a way to find duplicate photos across folders using EXIF or image content?

Asked 6/27/2015

118 views

2 answers

0

I want to compare two folders of image files and identify duplicates or likely matches. File size and filesystem dates are unreliable because they can change during copying or editing, so I’d prefer to compare based on EXIF metadata or the image data itself. Is there a tool that can do this across folders, ideally including photos that were saved at different sizes or compression levels?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

11y ago

2 Answers

3

Yes, there is, but you will need to be comfortable with the command line to do it. It will work best if you are in a unix/posix environment. This is available for Windows as an add-on using cygwin.

The program is exif tool Instructions for getting and installing.

Here are some examples

You will want something like

exiftool -CreateDate /path/to/folder/*.jpg

It will spew the filename and the create date of each.

Do this for each folder. Sort the two lists together. Now look at the corresponding files that have the same date.

*** Method 2. Create a temp directory Copy the content of both folders into it. Use a program that reads the creation date out of the file. (Aperture does this)
Files with the same date will show up next to each other.

Note: Different programs that edit images do not respect all metadata. You have to do substantial sanity checking on this sort of project.

Note: If you start with a raw format, process it into a JPEG, then the createfile time stamp of the JPEG may be the same as that of the raw file, or that of the time it was created. (Software should only change the Modify tag)

Note: If you are mixing up files, you want to be able to get back to where you were. Lot to be said for giving each file a keyword as to it's source: E.g. keyword folder:/path/to/folder1 for the ones that were originally in folder 1.

Note: exiftool allows you to rename files. You can rename files as date-stamp-original filename. This would make the files sort alphabetically in the order they were created.

It's really easy to shoot yourself in the foot. E.g. if you rename files to the date stamp, then if you have 2 shots with the same time stamp, one is overwritten. Exiftool can protect you from this with an incremental counter.

Originally by user17873. Source · Licensed CC BY-SA 4.0

user17873

9y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Yes. A few options mentioned by the community can help:

  • ExifTool: useful if you’re comfortable with the command line. You can extract fields like CreateDate from each folder, sort the results, and compare matching timestamps. This is metadata-based, so it works best when EXIF has been preserved.
  • git-diff-image: a command-line option for macOS and Linux that can compare images directly.
  • dupeguru: a GUI tool that may be the most practical choice. In picture mode it can find exact duplicates and also likely matches, such as the same photo saved with different resolution, crop, or compression.

Important caveat: EXIF is not a perfect duplicate test. Metadata can be changed or stripped by editing software, and different photos can share the same capture time. If your goal is true duplicate detection, image-content comparison is usually more reliable than relying only on EXIF fields.

UniqueBot

AI

11y ago

Your Answer