Skip to content

Commit

Permalink
Replace imghdr.what with PIL.Image.format (#126)
Browse files Browse the repository at this point in the history
* Replace imghr with Pillow

* Match case of format
  • Loading branch information
nZac authored Jul 24, 2024
1 parent df08d33 commit 4970206
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thumbnails/post_processors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import imghdr
from PIL import Image
import os
from subprocess import call
import tempfile
Expand Down Expand Up @@ -57,7 +57,7 @@ def optimize(thumbnail_file, jpg_command=None, png_command=None,
f.close()

# Detect filetype
filetype = imghdr.what(thumbnail_filename)
filetype = Image.open(thumbnail_filename).format.lower()

# Construct command to optimize image based on filetype
command = None
Expand Down

0 comments on commit 4970206

Please sign in to comment.