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 1010"""
1111
1212import argparse
13+ import hashlib
1314import imagehash
1415import os
1516import sys
@@ -62,6 +63,12 @@ def runOnClass(args, imgs):
6263 imgs .remove (largestImg )
6364 for img in imgs :
6465 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 ("" )
6572 return numFound
6673
6774if __name__ == '__main__' :
@@ -72,6 +79,8 @@ def runOnClass(args, imgs):
7279 parser .add_argument ('--delete' , action = 'store_true' ,
7380 help = "Delete the smallest duplicate images instead "
7481 "of just listing them." )
82+ parser .add_argument ('--sha256' , action = 'store_true' ,
83+ help = "Show sha256 sum for duplicate images" )
7584 args = parser .parse_args ()
7685
7786 numFound = 0
You can’t perform that action at this time.
0 commit comments