diff --git a/drama/helpers/images.py b/drama/helpers/images.py index 93c666ed7..0eaeea86a 100644 --- a/drama/helpers/images.py +++ b/drama/helpers/images.py @@ -31,9 +31,10 @@ def crop_and_resize(img, resize): def upload_file(file, resize=None): - + if resize: - filename = "image" + filename = "image.png" + remove(filename) file.save(filename) i = IImage.open(filename) i = crop_and_resize(i, resize) diff --git a/drama/routes/settings.py b/drama/routes/settings.py index 0abc6d847..c23277740 100644 --- a/drama/routes/settings.py +++ b/drama/routes/settings.py @@ -328,10 +328,10 @@ def settings_images_profile(v): g.db.rollback() abort(413) - highres = upload_file(request.files["profile"]) imageurl = upload_file(request.files["profile"], (100, 100)) if imageurl: - v.highres = highres + highres = upload_file(request.files["profile"]) + if highres: v.highres = highres v.profileurl = imageurl g.db.add(v)