Skip to content

Commit

Permalink
image hash test
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoralcz committed Nov 5, 2021
1 parent 93c4316 commit bfb723f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/api/handlers/imagehash.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

def imagehashed(url: str):
response = requests.get(url)
print("url", url)
buffer = response.content

im = Image.open(BytesIO(buffer))
avg_hash = imagehash.average_hash(im)

return { "hash": str(avg_hash)}
return { "hash": str(avg_hash) }

0 comments on commit bfb723f

Please sign in to comment.