Small improvements

This commit is contained in:
adi 2016-06-18 11:43:34 +02:00
parent 91db36c535
commit ae7de5a499
2 changed files with 2 additions and 3 deletions

View file

@ -28,7 +28,7 @@ class ImageForm(forms.Form):
file_name = str(self.files['image'])
thumb_io.seek(0, os.SEEK_END)
img = InMemoryUploadedFile(thumb_io, "image", file_name, self.files['image'].content_type, thumb_io.tell(), None)
img = InMemoryUploadedFile(thumb_io, None, file_name, self.files['image'].content_type, thumb_io.tell(), None)
unique_file_name = self.get_unique_file_name(file_name)
full_path = os.path.join(MARKDOWNX_MEDIA_PATH, unique_file_name)

View file

@ -38,8 +38,7 @@ def scale_and_crop(image, size, crop=False, upscale=False, quality=None):
target_y = source_y * scale
if scale < 1.0 or (scale > 1.0 and upscale):
im = im.resize((int(source_x * scale), int(source_y * scale)),
resample=Image.ANTIALIAS)
im = im.resize((int(source_x * scale), int(source_y * scale)), resample=Image.ANTIALIAS)
if crop:
# Use integer values now.