From c1820df7b1f282211fc6554190b0aab600001ced Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sun, 13 Jan 2008 15:28:45 +0100 Subject: [PATCH] issue98, php script to locate duplicate images Signed-off-by: Andreas Unterkircher --- find_dups.php | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 find_dups.php diff --git a/find_dups.php b/find_dups.php new file mode 100755 index 0000000..32b95f4 --- /dev/null +++ b/find_dups.php @@ -0,0 +1,56 @@ +#!/usr/bin/php +
This script should only be invoked from command line!
\n"; + die; +} + +require_once "phpfspot.class.php"; + +$fspot = new PHPFSPOT; +$fspot->fromcmd = true; + +$all_dups = $fspot->cfg_db->db_query(" + SELECT i1.img_idx as i1, i2.img_idx as i2 + FROM images i1 + INNER JOIN images i2 + ON ( + i1.img_md5=i2.img_md5 + AND + i1.img_idx!=i2.img_idx + ) + ORDER BY i1.img_idx ASC +"); + +while($row = $fspot->cfg_db->db_fetch_object($all_dups)) { + if($photo1 = $fspot->getphotoname($row['i1'])) { + print "Dups for ". $photo1 ."\n"; + if($photo2 = $fspot->getphotoname($row['i2'])) { + print "\t". $photo2 ."\n"; + } + } +} + +?> -- 2.25.1