mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 11:28:14 +00:00
trezorctl: set homescreen for T2
This commit is contained in:
parent
6186822f14
commit
b42fc6fb1f
@ -209,7 +209,11 @@ def set_flags(connect, flags):
|
|||||||
@click.option('-f', '--filename', default=None)
|
@click.option('-f', '--filename', default=None)
|
||||||
@click.pass_obj
|
@click.pass_obj
|
||||||
def set_homescreen(connect, filename):
|
def set_homescreen(connect, filename):
|
||||||
if filename is not None:
|
if filename and filename.endswith('.toif'):
|
||||||
|
img = open(filename, 'rb').read()
|
||||||
|
if img[:8] != b'TOIf\x90\x00\x90\x00':
|
||||||
|
raise ValueError('File is not a TOIF file with size of 144x144')
|
||||||
|
elif filename is not None:
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
im = Image.open(filename)
|
im = Image.open(filename)
|
||||||
if im.size != (128, 64):
|
if im.size != (128, 64):
|
||||||
|
Loading…
Reference in New Issue
Block a user