fixed fingerprinting
This commit is contained in:
@@ -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:
|
||||
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
|
||||
if gray[2]=="255":
|
||||
values+='1'
|
||||
else:
|
||||
values+='0'
|
||||
return str(int(values,2))
|
||||
|
||||
def find_fingerprint_similar(opts):
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user