fix(python): missing PIL.Image.ANTIALIAS

[no changelog]
pull/3705/head
Martin Milata 1 month ago
parent 3d1e2bc20d
commit 418bc924c4

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

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

@ -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?",
default=True,
):
image = image.resize(T1_TR_IMAGE_SIZE, Image.ANTIALIAS)
image = image.resize(T1_TR_IMAGE_SIZE, Image.Resampling.LANCZOS)
else:
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?",
default=True,
):
image = image.resize((width, height), Image.ANTIALIAS)
image = image.resize((width, height), Image.Resampling.LANCZOS)
else:
raise click.ClickException(
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?",
default=True,
):
image = image.resize((width, height), Image.ANTIALIAS)
image = image.resize((width, height), Image.Resampling.LANCZOS)
else:
raise click.ClickException(
f"Wrong size of image - should be {width}x{height}"

Loading…
Cancel
Save