fixed fingerprinting

This commit is contained in:
ville rantanen
2019-04-29 12:28:09 +03:00
parent 5991f6b9b9
commit a93b73b76b
2 changed files with 53 additions and 50 deletions

View File

@@ -587,13 +587,15 @@ def get_fingerprint(filename):
img, err = p.communicate()
values=''
for row in img.split('\n'):
gray=row.split(',')
if len(gray)<3:
continue
if gray[2]=="255":
values+='1'
else:
values+='0'
if row.find("gray(0)") > 0:
values += '0'
continue
if row.find("gray(255)") > 0:
values += '1'
continue
if row.find("gray(65535)") > 0:
values += '1'
continue
return str(int(values,2))
def find_fingerprint_similar(opts):

View File

@@ -56,6 +56,7 @@ class Click:
if t<34:
self.tags.append(Button(self.top,text="[%s] %s"%(self._hotkey(t+1),self.tagTexts[t]), command=return_func))
self.root.bind(self._hotkey(t+1), self._tag_key)
sys.stdout.write("\n%s: %s"%( self._hotkey(t+1), self.tagTexts[t]) )
#self.top.bind(str(t), self._tag_key)
continue
self.tags.append(Button(self.top,text=self.tagTexts[t], command=return_func))