mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-04-20 13:10:59 +00:00
Small improvements
This commit is contained in:
parent
91db36c535
commit
ae7de5a499
2 changed files with 2 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue