u2f over nfc

https://github.com/flipperdevices/flipperzero-firmware/pull/1755
from @devsnek

may need more testing
This commit is contained in:
jbohack
2023-01-11 19:15:06 -05:00
parent d0d0e8d1d8
commit ea0b5488ad
13 changed files with 327 additions and 66 deletions

View File

@@ -60,7 +60,10 @@ class ImageTools:
with Image.open(file) as im:
with io.BytesIO() as output:
bw = im.convert("1")
bw = ImageOps.invert(bw)
try:
bw = ImageOps.invert(bw)
except OSError:
bw = bw.point(lambda x: 255 - x)
bw.save(output, format="XBM")
return output.getvalue()