Skip to content

Commit

Permalink
Fix test failure in plone.formwidget.namedfile, where image bytes wer…
Browse files Browse the repository at this point in the history
…e directly saved as image value
  • Loading branch information
datakurre committed Apr 23, 2020
1 parent 942d34d commit 5a4a41d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plone/namedfile/scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,11 @@ def __call__(
if height is None and width is None:
dummy, format_ = orig_value.contentType.split("/", 1)
return None, format_, (orig_value._width, orig_value._height)
elif height == orig_value._height and width == orig_value._width:
if not parameters:
dummy, format_ = orig_value.contentType.split("/", 1)
return orig_value, format_, (orig_value._width, orig_value._height)
elif not parameters and height and width \
and height == getattr(orig_value, "_height", None) \
and width == getattr(orig_value, "_width", None):
dummy, format_ = orig_value.contentType.split("/", 1)
return orig_value, format_, (orig_value._width, orig_value._height)
orig_data = None
try:
orig_data = orig_value.open()
Expand Down

0 comments on commit 5a4a41d

Please sign in to comment.