Skip to content

Commit

Permalink
fix: remove use of imghdr
Browse files Browse the repository at this point in the history
  • Loading branch information
desbma committed May 17, 2024
1 parent a34f5c4 commit c1743a4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sacad/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import asyncio
import enum
import imghdr
import io
import itertools
import logging
Expand Down Expand Up @@ -588,8 +587,7 @@ def guessImageMetadataFromData(img_data):
try:
img = PIL.Image.open(img_stream)
except (IOError, OSError, RuntimeError): # PIL.UnidentifiedImageError inherits from OSError
format = imghdr.what(None, h=img_data)
format = SUPPORTED_IMG_FORMATS.get(format, None)
pass
else:
format = img.format.lower()
format = SUPPORTED_IMG_FORMATS.get(format, None)
Expand Down

0 comments on commit c1743a4

Please sign in to comment.