Skip to content

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

@SchrammAntoine

Description

@SchrammAntoine

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions