Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions flask_appbuilder/filemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,17 @@ def resize(self, image, size):
"""
Resizes the image

:param image: The image object
:param size: size is PIL tuple (width, heigth, force) ex: (200,100,True)
:param image: The image object
:param size: size is PIL tuple (width, height, force) ex: (200,100,True)
"""
(width, height, force) = size

if image.size[0] > width or image.size[1] > height:
if force:
return ImageOps.fit(self.image, (width, height), Image.ANTIALIAS)
return ImageOps.fit(self.image, (width, height), Image.LANCZOS)
else:
thumb = self.image.copy()
thumb.thumbnail((width, height), Image.ANTIALIAS)
thumb.thumbnail((width, height), Image.LANCZOS)
return thumb

return image
Expand Down
2 changes: 1 addition & 1 deletion requirements-extra.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pillow~=9.1
Pillow~=10.0.1
cython==0.29.17
mysqlclient==2.0.1
psycopg2-binary==2.9.6
Expand Down