Commit 9c850fb3 authored by Serge S. Koval's avatar Serge S. Koval

Minor FileUploadField corrections

parent 016e4d52
...@@ -314,6 +314,9 @@ class ImageUploadField(FileUploadField): ...@@ -314,6 +314,9 @@ class ImageUploadField(FileUploadField):
:param max_size: :param max_size:
Tuple of (width, height, force) or None. If provided, Flask-Admin will Tuple of (width, height, force) or None. If provided, Flask-Admin will
resize image to the desired size. resize image to the desired size.
Width and height is in pixels. If `force` is set to `True`, will try to fit image into dimensions and
keep aspect ratio, otherwise will just resize to target size.
:param thumbgen: :param thumbgen:
Thumbnail filename generation function. All thumbnails will be saved as JPEG files, Thumbnail filename generation function. All thumbnails will be saved as JPEG files,
so there's no need to keep original file extension. so there's no need to keep original file extension.
...@@ -391,7 +394,7 @@ class ImageUploadField(FileUploadField): ...@@ -391,7 +394,7 @@ class ImageUploadField(FileUploadField):
path = self._get_path(filename) path = self._get_path(filename)
if not op.exists(op.dirname(path)): if not op.exists(op.dirname(path)):
os.makedirs(os.path.dirname(path), self.permission) os.makedirs(os.path.dirname(path), self.permission | 0o111)
# Figure out format # Figure out format
filename, format = self._get_save_format(filename, self.image) filename, format = self._get_save_format(filename, self.image)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment