Link.FYI

Pastebin

Create New My Pastes

Code (PHP) pasted on 2018-12-05, 20:33 Raw Source

  1. jean@asuna:~/Projekte/Image/DuplicateFinder$ php test.php
  2. /home/jean/Projekte/Image/DuplicateFinder/test.php:36:
  3. array(17) {
  4.   '/home/jean/test/10/01/_.jpg' =>
  5.   array(1) {
  6.     [0] =>
  7.     string(34) "/home/jean/test/10/01/100_0067.jpg"
  8.   }
  9.   '/home/jean/test/10/01/100_0065.jpg' =>
  10.   array(2) {
  11.     [0] =>
  12.     string(34) "/home/jean/test/09/01/100_0065.jpg"
  13.     [1] =>
  14.     string(34) "/home/jean/test/08/01/100_0065.jpg"
  15.   }
  16.   '/home/jean/test/10/01/100_0068.jpg' =>
  17.   array(2) {
  18.     [0] =>
  19.     string(34) "/home/jean/test/09/01/100_0068.jpg"
  20.     [1] =>
  21.     string(34) "/home/jean/test/08/01/100_0068.jpg"
  22.   }
  23.   '/home/jean/test/10/01/100_0067.jpg' =>
  24.   array(2) {
  25.     [0] =>
  26.     string(34) "/home/jean/test/09/01/100_0067.jpg"
  27.     [1] =>
  28.     string(34) "/home/jean/test/08/01/100_0067.jpg"
  29.   }
  30.   '/home/jean/test/07/30/bild24.jpg' =>
  31.   array(1) {
  32.     [0] =>
  33.     string(36) "/home/jean/test/07/30/f530019248.jpg"
  34.   }
  35.  
  36.  
  37. // ---- snip ----
  38.  
  39. foreach($files as $file)
  40.  foreach ($this->finders as $finder) {
  41.                         $finderName = $finder->getName();
  42.                         $hash = $finder->getHash($file);
  43.                         if (isset($this->hashes[$finderName][$hash])) {
  44.                             $reference = $this->hashes[$finderName][$hash];
  45.                             $this->duplicates[$reference][] = $file;
  46.                             break;
  47.                         }
  48.                         $this->hashes[$finderName][$hash] = $file;
  49.                     }