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:
@@ -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
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user