Browse Source

Store thumbnails in PNG format, always

rafalp 2 years ago
parent
commit
835e5cb709
1 changed files with 2 additions and 2 deletions
  1. 2 2
      misago/threads/models/attachment.py

+ 2 - 2
misago/threads/models/attachment.py

@@ -118,9 +118,9 @@ class Attachment(models.Model):
                 # normalize jpg to jpeg for Pillow
                 # normalize jpg to jpeg for Pillow
                 thumbnail.save(thumb_stream, "jpeg")
                 thumbnail.save(thumb_stream, "jpeg")
             else:
             else:
-                thumbnail.save(thumb_stream, fileformat)
+                thumbnail.save(thumb_stream, "png")
         elif strip_animation:
         elif strip_animation:
-            thumbnail.save(thumb_stream, fileformat)
+            thumbnail.save(thumb_stream, "png")
 
 
         if downscale_image or strip_animation:
         if downscale_image or strip_animation:
             self.thumbnail = ContentFile(thumb_stream.getvalue(), upload.name)
             self.thumbnail = ContentFile(thumb_stream.getvalue(), upload.name)