diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-04-29 01:36:27 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-04-29 01:36:27 +0200 |
| commit | 86e34a1bc43d1995e20c52fa639412c46105d400 (patch) | |
| tree | 35623620556e6cfac2ca67e2b6f4f61cd2329e2a /check/commands/phash/dedupe.py | |
| parent | dbfaa9024c844dd5c14259c858564e32149afd87 (diff) | |
Diffstat (limited to 'check/commands/phash/dedupe.py')
| -rw-r--r-- | check/commands/phash/dedupe.py | 5 |
1 files changed, 4 insertions, 1 deletions
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) |
