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() img, err = p.communicate()
values='' values=''
for row in img.split('\n'): for row in img.split('\n'):
gray=row.split(',') if row.find("gray(0)") > 0:
if len(gray)<3: values += '0'
continue continue
if gray[2]=="255": if row.find("gray(255)") > 0:
values+='1' values += '1'
else: continue
values+='0' if row.find("gray(65535)") > 0:
values += '1'
continue
return str(int(values,2)) return str(int(values,2))
def find_fingerprint_similar(opts): def find_fingerprint_similar(opts):

View File

@@ -56,6 +56,7 @@ class Click:
if t<34: if t<34:
self.tags.append(Button(self.top,text="[%s] %s"%(self._hotkey(t+1),self.tagTexts[t]), command=return_func)) 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) 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) #self.top.bind(str(t), self._tag_key)
continue continue
self.tags.append(Button(self.top,text=self.tagTexts[t], command=return_func)) self.tags.append(Button(self.top,text=self.tagTexts[t], command=return_func))