1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

[#162 state:fixed] Apply the 'Match scaled pictures' option to exif timestamp scan type.

This commit is contained in:
Virgil Dupras
2011-06-15 10:13:03 -04:00
parent 4399fe9d17
commit cd9fd3a10b
10 changed files with 21 additions and 59 deletions

View File

@@ -16,7 +16,7 @@ from hscommon.trans import tr
from core.engine import Match
from . import exif
def getmatches(files, j):
def getmatches(files, match_scaled, j):
timestamp2pic = defaultdict(set)
for picture in j.iter_with_progress(files, tr("Read EXIF of %d/%d pictures")):
try:
@@ -30,5 +30,8 @@ def getmatches(files, j):
del timestamp2pic['0000:00:00 00:00:00']
matches = []
for pictures in timestamp2pic.values():
matches += [Match(p1, p2, 100) for p1, p2 in combinations(pictures, 2)]
for p1, p2 in combinations(pictures, 2):
if (not match_scaled) and (p1.dimensions != p2.dimensions):
continue
matches.append(Match(p1, p2, 100))
return matches

View File

@@ -20,7 +20,7 @@ class ScannerPE(Scanner):
if self.scan_type == ScanType.FuzzyBlock:
return matchblock.getmatches(files, self.cache_path, self.threshold, self.match_scaled, j)
elif self.scan_type == ScanType.ExifTimestamp:
return matchexif.getmatches(files, j)
return matchexif.getmatches(files, self.match_scaled, j)
else:
raise Exception("Invalid scan type")