jfinkels committed f27ed60 Merge

Merged from branch noimagecompression.

Comments (0)

Files changed (1)


 from .queries import Q_UPDATE_PHOTO_DISPLAYPOS
+"""The quality (as an integer between 1 and 100, inclusive) of the JPEG image
+saved after the used uploads an image file to the application.
+A value greater than 95 is not recommended by the Python Image Library; see
+here_ for more information.
+.. _here:
 def _get_last_display_position(categoryid):
     """Helper method which returns the index in the display sequence of the
     last photo in the specified category.
         height = int(app.config['SPLASH_PHOTO_HEIGHT'])
         if img.size[0] > width or img.size[1] > height:
             img = img.resize((width, height), Image.ANTIALIAS)
-, imagetype)
+, imagetype, quality=IMAGE_QUALITY)
         return make_response(None, 204)
         thumbnail = img.copy()
         thumbnail.thumbnail(app.config['THUMBNAIL_SIZE'], Image.ANTIALIAS)
         # save the image and the thumbnail
-, imagetype)
+, imagetype, quality=IMAGE_QUALITY), imagetype)
         # get the category and display position to set for this photo
         categoryid = int(request.form['categoryid'])