Revert NFC u2f

This commit is contained in:
VerstreuteSeele
2023-01-14 09:00:41 +01:00
parent 905bb23fdf
commit 49dabee42f
13 changed files with 65 additions and 308 deletions

View File

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