From 86e34a1bc43d1995e20c52fa639412c46105d400 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 29 Apr 2019 01:36:27 +0200 Subject: import csv --- check/commands/phash/dedupe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'check/commands/phash/dedupe.py') diff --git a/check/commands/phash/dedupe.py b/check/commands/phash/dedupe.py index 28266f4..6b8194b 100644 --- a/check/commands/phash/dedupe.py +++ b/check/commands/phash/dedupe.py @@ -17,7 +17,7 @@ from app.utils.file_utils import write_json, sha256 help="Input glob to search -- e.g. '../docs/images/*.jpg'") @click.option('-o', '--output', 'opt_output_fn', required=False, - help="Input glob to search -- e.g. '../docs/images/*.jpg'") + help="Output filename") @click.option('-t', '--threshold', 'opt_threshold', required=True, default=6, @@ -36,10 +36,13 @@ def cli(ctx, opt_input_glob, opt_output_fn, opt_threshold): phash = compute_phash(im) if is_phash_new(fn, phash, seen, opt_threshold): hash = sha256(fn) + fpart, ext = os.path.splitext(fn) + ext = ext[1:] seen.append({ 'sha256': hash, 'phash': phash, 'fn': fn, + 'ext': ext, }) if opt_output_fn: write_json(seen, opt_output_fn) -- cgit v1.2.3-70-g09d2