File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 10
10
"""
11
11
12
12
import argparse
13
+ import hashlib
13
14
import imagehash
14
15
import os
15
16
import sys
@@ -62,6 +63,12 @@ def runOnClass(args, imgs):
62
63
imgs .remove (largestImg )
63
64
for img in imgs :
64
65
os .remove (img )
66
+
67
+ if args .sha256 :
68
+ print ("" )
69
+ for img in imgs :
70
+ print (hashlib .sha256 (open (img , 'rb' ).read ()).hexdigest ())
71
+ print ("" )
65
72
return numFound
66
73
67
74
if __name__ == '__main__' :
@@ -72,6 +79,8 @@ def runOnClass(args, imgs):
72
79
parser .add_argument ('--delete' , action = 'store_true' ,
73
80
help = "Delete the smallest duplicate images instead "
74
81
"of just listing them." )
82
+ parser .add_argument ('--sha256' , action = 'store_true' ,
83
+ help = "Show sha256 sum for duplicate images" )
75
84
args = parser .parse_args ()
76
85
77
86
numFound = 0
You can’t perform that action at this time.
0 commit comments