Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

../utility/plot_path.py deprecation warning #2

Open
SchrammAntoine opened this issue Sep 28, 2024 · 1 comment
Open

../utility/plot_path.py deprecation warning #2

SchrammAntoine opened this issue Sep 28, 2024 · 1 comment

Comments

@SchrammAntoine
Copy link

Dear RAFFT makers,

I encountered some compatibility issues while running plot_path.py with the latest version of Pillow (10.4.0). Since the release of Pillow 10.0.0, the following changes are affecting the script:

If you are interested in upgrading plot_path.py for Pillow 10+, below the updates to consider :

Line 60 (add_grad_img) :

draw = ImageDraw.Draw(path_img)
#x_size, y_size = fnt.getsize("{:.1f}".format(max_val)) ## DEPRECATED
bbox = fnt.getbbox("{:.1f}".format(max_val)) # update
x_size, y_size = bbox[2] - bbox[0], bbox[3] - bbox[1] # update

Line 177 (main) :

#cur_str = cur_str.resize((n_fig_w, n_fig_h), Image.ANTIALIAS) ## DEPRECATED
cur_str = cur_str.resize((n_fig_w, n_fig_h), Image.Resampling.LANCZOS) # update

Line 208 (main) :

#cur_str = cur_str.resize((n_fig_w, n_fig_h), Image.ANTIALIAS) ## DEPRECATED
cur_str = cur_str.resize((n_fig_w, n_fig_h),Image.Resampling.LANCZOS) # update

Many thanks for this very nice tool,

Best

AS

@vaiteaopuu
Copy link
Collaborator

Dear SchrammAntoine,

Sorry for the late reply, but thank you for the updates, I introduced them.

Best,

Vaitea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants