mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 12:28:09 +00:00
fix(python): only even-width grayscale icons are supported
[no changelog]
This commit is contained in:
parent
c257a8a687
commit
38ad9ab9e5
@ -155,6 +155,8 @@ def from_image(
|
|||||||
|
|
||||||
if image.mode == "L":
|
if image.mode == "L":
|
||||||
toif_mode = firmware.ToifMode.grayscale
|
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())
|
toif_data = _from_pil_grayscale(image.getdata())
|
||||||
elif image.mode == "RGB":
|
elif image.mode == "RGB":
|
||||||
toif_mode = firmware.ToifMode.full_color
|
toif_mode = firmware.ToifMode.full_color
|
||||||
|
Loading…
Reference in New Issue
Block a user