Slashdot Mirror


Does Anyone Make a Photo De-Duplicator For Linux? Something That Reads EXIF?

postbigbang writes "Imagine having thousands of images on disparate machines. many are dupes, even among the disparate machines. It's impossible to delete all the dupes manually and create a singular, accurate photo image base? Is there an app out there that can scan a file system, perhaps a target sub-folder system, and suck in the images-- WITHOUT creating duplicates? Perhaps by reading EXIF info or hashes? I have eleven file systems saved, and the task of eliminating dupes seems impossible."

15 of 243 comments (clear)

  1. fdupes -rd by Anonymous Coward · · Score: 5, Informative

    I've had the same problem as I stupidly try to make the world a better place by renaming or putting them in sub-directories.

    fdupes will do a bit-wise comparison. -r = recurse. -d = delete.

    fdupes would be the fastest way.

  2. Re:write it yourself by Anonymous Coward · · Score: 5, Informative

    ExifTool is probably your best start:

    http://www.sno.phy.queensu.ca/~phil/exiftool/

  3. Write a quick script. by khasim · · Score: 4, Informative

    If they are identical then their hashes should be identical.

    So write a script that generates hashes for each of them and checks for duplicate hashes.

  4. fslint by innocent_white_lamb · · Score: 3, Informative

    fslint is a toolkit to find all redundant disk usage (duplicate files
    for e.g.). It includes a GUI as well as a command line interface.

    http://www.pixelbeat.org/fslin...

    --
    If you're a zombie and you know it, bite your friend!
  5. Geeqie by zakkie · · Score: 4, Informative

    Works excellently for this.

  6. Re:ZFS dedup by Anonymous Coward · · Score: 3, Informative

    Have you read the zfs documentation? Setting zfs dedup does not remove duplicate files (per OP request, since there are eleven different file systems), but removes redundant storage for files which are duplicates. In other words, if you have the exact same picture in three different folders/subdirectories on the same file system, zfs will only allocate storage for one copy of the data, and point the three file entries to that one copy. Similar to how hard links work in ext2 and friends.

  7. General case by xaxa · · Score: 5, Informative

    For the general case (any file), I've used this script:


    #!/bin/sh

    OUTF=rem-duplicates.sh;

    echo "#! /bin/sh" > $OUTF;

    find "$@" -type f -print0 |
        xargs -0 -n1 md5sum |
            sort --key=1,32 | uniq -w 32 -d --all-repeated=separate |
                sed -r 's/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1/g;s/(.+)/#rm \1/' >> $OUTF;

    chmod a+x $OUTF; ls -l $OUTF

    It should be straightforward to change "md5sum" to some other key -- e.g. EXIF Date + some other EXIF fields.

    (Also, isn't this really a question for superuser.com or similar?)

    1. Re:General case by Forever+Wondering · · Score: 3, Informative

      (Also, isn't this really a question for superuser.com or similar?)

      Possibly ;-)
      http://superuser.com/questions...

      --
      Like a good neighbor, fsck is there ...
  8. Re:write it yourself by shipofgold · · Score: 4, Informative

    I second exiftool. Lots of options to rename files. If you rename files based on createtime and perhaps other fields like resolution you will end up with unique filenames and then you can filter the duplicates

    Here is a quick command which will rename every file in a directory according to createDate

      exiftool "-FileNameCreateDate" -d "%Y%m%d_%H%M%S.%%e" DIR

    If the files were all captured with the same device it is probably super easy since the exif info will be consistent. If the files are from lots of different sources...good luck.

  9. Re:Don't reinvent the wheel: fdupes, md5deep, gqvi by rwa2 · · Score: 5, Informative

    Yeah, this Ask Slashdot should really be about teaching people how to search for packages in aptitude or whatever your package manager is...
    Here are some others:

    findimagedupes
    Finds visually similar or duplicate images
    findimagedupes is a commandline utility which performs a rough "visual diff" to
    two images. This allows you to compare two images or a whole tree of images and
    determine if any are similar or identical. On common image types,
    findimagedupes seems to be around 98% accurate.
    Homepage: http://www.jhnc.org/findimaged...

    fslint :

    kleansweep :
    File cleaner for KDE
    KleanSweep allows you to reclaim disk space by finding unneeded files. It can
    search for files basing on several criterias; you can seek for:
    * empty files
    * empty directories
    * backup files
    * broken symbolic links
    * broken executables (executables with missing libraries)
    * dead menu entries (.desktop files pointing to non-existing executables)
    * duplicated files ...
    Homepage: http://linux.bydg.org/~yogin/

    komparator :
    directories comparator for KDE
    Komparator is an application that searches and synchronizes two directories. It
    discovers duplicate, newer or missing files and empty folders. It works on
    local and network or kioslave protocol folders.
    Homepage: http://komparator.sourceforge....

    backuppc : (just in case this was related to your intended use case for some reason)
    high-performance, enterprise-grade system for backing up PCs
    BackupPC is disk based and not tape based. This particularity allows features #
    not found in any other backup solution:
    * Clever pooling scheme minimizes disk storage and disk I/O. Identical files
        across multiple backups of the same or different PC are stored only once
        resulting in substantial savings in disk storage and disk writes. Also known
        as "data deduplication".

    I bet if you throw Picasa at your combined images directory, it might have some kind of "similar image" detection too, particularly since its sorts everything by exif timestamp.

    That said, I've never had to use any of this stuff, because my habit was to rename my camera image dumps to a timestamped directory (e.g. 20140123_DCIM ) to begin with, and upload it to its final resting place on my main file server immediately, so I know all other copies I encounter on other household machines are redundant.

  10. Re:Seriously? by zakkie · · Score: 5, Informative

    See my earlier contrivution: geeqie. It will even scan for image similarity not just rudimentary hashing. Someone else mentioned gqview & that it was out of date - geeqie is what gqview became.

  11. Re:You don't need software for this by unrtst · · Score: 3, Informative

    Adjust as needed:

    find ./ -type f -iname '*.jpg' -exec md5sum {} \; > image_md5.txt
    cat image_md5.txt | cut -d" " -f1 | sort | uniq -d | while read md5; do grep $md5 image_md5.txt; done

    ...though I think something more sophisticated than an md5sum would be wise (exif data could have been changed but nothing else, and you'd miss that dupe).

  12. Re:write it yourself by Anonymous Coward · · Score: 3, Informative

    I use VisiPics for Windows. It's a free software that actually analyses the content of images to find duplicates. This works very well because images may not have exif data or the same image may be different file sizes or formats.

    I don't know if it will work under Wine, but it's worth a try.

  13. Re:Hashes should be relatively easy by TsuruchiBrian · · Score: 3, Informative

    md5 is a 128bit hash. Assuming your not trying to create collisions, the odds of you getting a collision in n files is:

    p = 1 - (2^128)! / ((2^128 - n)! * (2^128)^n)

    This is an expression that starts at 0 and gradually goes to 1 as n goes to infinity.

    These numbers are so big, I have no idea how to even solve for n to get something like p = 0.0001%, without using a bignumber package, but I imagine n would have to be *REALLY* big in order to get a p significantly above 0

  14. Visipics is excellent. by micronicos · · Score: 3, Informative

    I use VisiPics for Windows. It's a free software that actually analyses the content of images to find duplicates. This works very well because images may not have exif data or the same image may be different file sizes or formats.
    I don't know if it will work under Wine, but it's worth a try.

    Visipics is the only tool I have ever found that will reliably use image matching to dedupe; it is Windows only but I have used it on my own collections & it works very well indeed: http://www.visipics.info/

    Now (v1.31) understands .raw as well as all other main image formats & can handle rotated images; brilliant little program!

    --
    Nico M, London, GB.