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

fix(python): missing PIL.Image.ANTIALIAS

[no changelog]
This commit is contained in:
Martin Milata 2024-04-10 11:24:52 +02:00
parent 3d1e2bc20d
commit 418bc924c4
3 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
hidapi>=0.7.99.post20 hidapi>=0.7.99.post20
web3>=5 web3>=5
Pillow Pillow>=10
stellar-sdk>=6 stellar-sdk>=6
rlp>=1.1.0 ; python_version<'3.7' rlp>=1.1.0 ; python_version<'3.7'

View File

@ -29,7 +29,7 @@ extras_require = {
"hidapi": ["hidapi>=0.7.99.post20"], "hidapi": ["hidapi>=0.7.99.post20"],
"ethereum": ["rlp>=1.1.0 ; python_version<'3.7'", "web3>=5"], "ethereum": ["rlp>=1.1.0 ; python_version<'3.7'", "web3>=5"],
"qt-widgets": ["PyQt5"], "qt-widgets": ["PyQt5"],
"extra": ["Pillow"], "extra": ["Pillow>=10"],
"stellar": ["stellar-sdk>=6"], "stellar": ["stellar-sdk>=6"],
} }

View File

@ -64,7 +64,7 @@ def image_to_t1(filename: Path) -> bytes:
f"Image is not 128x64, but {image.size}. Do you want to resize it automatically?", f"Image is not 128x64, but {image.size}. Do you want to resize it automatically?",
default=True, default=True,
): ):
image = image.resize(T1_TR_IMAGE_SIZE, Image.ANTIALIAS) image = image.resize(T1_TR_IMAGE_SIZE, Image.Resampling.LANCZOS)
else: else:
raise click.ClickException("Wrong size of the image - should be 128x64") raise click.ClickException("Wrong size of the image - should be 128x64")
@ -99,7 +99,7 @@ def image_to_toif(filename: Path, width: int, height: int, greyscale: bool) -> b
f"Image is not {width}x{height}, but {image.size[0]}x{image.size[1]}. Do you want to resize it automatically?", f"Image is not {width}x{height}, but {image.size[0]}x{image.size[1]}. Do you want to resize it automatically?",
default=True, default=True,
): ):
image = image.resize((width, height), Image.ANTIALIAS) image = image.resize((width, height), Image.Resampling.LANCZOS)
else: else:
raise click.ClickException( raise click.ClickException(
f"Wrong size of image - should be {width}x{height}" f"Wrong size of image - should be {width}x{height}"
@ -137,7 +137,7 @@ def image_to_jpeg(filename: Path, width: int, height: int) -> bytes:
f"Image is not {width}x{height}, but {image.size[0]}x{image.size[1]}. Do you want to resize it automatically?", f"Image is not {width}x{height}, but {image.size[0]}x{image.size[1]}. Do you want to resize it automatically?",
default=True, default=True,
): ):
image = image.resize((width, height), Image.ANTIALIAS) image = image.resize((width, height), Image.Resampling.LANCZOS)
else: else:
raise click.ClickException( raise click.ClickException(
f"Wrong size of image - should be {width}x{height}" f"Wrong size of image - should be {width}x{height}"