1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 04:18:10 +00:00

fix(python): only even-width grayscale icons are supported

[no changelog]
This commit is contained in:
Pavol Rusnak 2022-05-07 16:27:13 +02:00 committed by matejcik
parent c257a8a687
commit 38ad9ab9e5

View File

@ -155,6 +155,8 @@ def from_image(
if image.mode == "L":
toif_mode = firmware.ToifMode.grayscale
if image.size[0] % 2 != 0:
raise ValueError("Only even-width grayscale images are supported")
toif_data = _from_pil_grayscale(image.getdata())
elif image.mode == "RGB":
toif_mode = firmware.ToifMode.full_color