Skip to content

Commit

Permalink
Use "tiff" extension for TIFF files to match imghdr
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwilsdon committed Nov 3, 2024
1 parent 49da972 commit 52b5e23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mediafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ def image_mime_type(data):


def image_extension(data):
return filetype.guess_extension(data)
ext = filetype.guess_extension(data)
# imghdr returned "tiff", so we should keep returning it with filetype.
return ext if ext != 'tif' else 'tiff'


class ImageType(enum.Enum):
Expand Down

0 comments on commit 52b5e23

Please sign in to comment.