Skip to content

Commit

Permalink
Use original file extension when creating thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Jarocki committed Feb 26, 2019
1 parent 2543c5d commit 4376b88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion onadata/libs/utils/image_tools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os.path
import requests

from cStringIO import StringIO
Expand Down Expand Up @@ -35,7 +36,8 @@ def get_dimensions((width, height), longest_side):


def _save_thumbnails(image, path, size, suffix):
nm = NamedTemporaryFile(suffix='.%s' % settings.IMG_FILE_TYPE)
image_ext = os.path.splitext(path)[1]
nm = NamedTemporaryFile(suffix='.%s' % image_ext)
default_storage = get_storage_class()()
try:
# Ensure conversion to float in operations
Expand Down

0 comments on commit 4376b88

Please sign in to comment.