Skip to content

Commit

Permalink
Use the mode parameter instead of direction when calling the scale
Browse files Browse the repository at this point in the history
method

The direction parameter is deprecated. This avoids the warning:

DeprecationWarning: The 'direction' option is deprecated, use 'mode' instead.
  • Loading branch information
wesleybl committed Mar 4, 2024
1 parent ce7bfbe commit b91ff1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/1758.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the ``mode`` parameter instead of ``direction`` when calling the ``scale`` method. @wesleybl
2 changes: 1 addition & 1 deletion src/plone/restapi/imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_original_image_url(context, fieldname, width, height):
if hasattr(images_view, "picture"):
scale_flags["pre"] = True
scale = images_view.scale(
fieldname, width=width, height=height, direction="thumbnail", **scale_flags
fieldname, width=width, height=height, mode="thumbnail", **scale_flags
)
if scale:
return scale.url
Expand Down

0 comments on commit b91ff1e

Please sign in to comment.