mirror of
https://github.com/Anjok07/ultimatevocalremovergui.git
synced 2025-02-17 11:18:37 +01:00
fix 'PIL.Image' has no attribute 'ANTIALIAS'
``` Traceback (most recent call last): File "\ultimatevocalremovergui\UVR.py", line 7288, in <module> root = MainWindow() File "\ultimatevocalremovergui\UVR.py", line 1350, in __init__ img = ImagePath(BASE_PATH) File "\ultimatevocalremovergui\gui_data\app_size_values.py", line 95, in __init__ self.efile_img = self.open_image(path=efile_path,size=(image_scale_1, image_scale_1)) File "\ultimatevocalremovergui\gui_data\app_size_values.py", line 135, in open_image img = img.resize((size[0], int(size[0] * ratio)), Image.ANTIALIAS) AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' ``` ANTIALIAS was removed in Pillow 10.0.0 (after being deprecated through many previous versions). Now you need to use PIL.Image.LANCZOS or PIL.Image.Resampling.LANCZOS. (This is the exact same algorithm that ANTIALIAS referred to, you just can no longer access it through the name ANTIALIAS.)
This commit is contained in:
parent
f81dfec089
commit
01128baa2c
@ -132,9 +132,9 @@ class ImagePath():
|
||||
if size is not None:
|
||||
size = (int(size[0]), int(size[1]))
|
||||
if keep_aspect:
|
||||
img = img.resize((size[0], int(size[0] * ratio)), Image.ANTIALIAS)
|
||||
img = img.resize((size[0], int(size[0] * ratio)), Image.Resampling.LANCZOS)
|
||||
else:
|
||||
img = img.resize(size, Image.ANTIALIAS)
|
||||
img = img.resize(size, Image.Resampling.LANCZOS)
|
||||
|
||||
return ImageTk.PhotoImage(img)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user