fix: warning if mode == crop and w or h missing

This commit is contained in:
relikd
2023-03-03 23:11:58 +01:00
parent 3c244b2e5a
commit 938b5bdc13

View File

@@ -124,5 +124,8 @@ def retina_thumbnail(
if not w and not h:
return image, ew, eh
else:
if not w or not h and mode == 'crop':
w = w or image.width
h = h or image.height
img = image.thumbnail(width=w, height=h, mode=mode, upscale=False)
return img, ew, eh