diff --git a/iopaint/helper.py b/iopaint/helper.py index 1c99dcf5..d795c1d4 100644 --- a/iopaint/helper.py +++ b/iopaint/helper.py @@ -1,5 +1,5 @@ import base64 -import imghdr +import filetype import io import os import sys @@ -298,7 +298,7 @@ def is_mac(): def get_image_ext(img_bytes): - w = imghdr.what("", img_bytes) + w = filetype.guess_extension(img_bytes) if w is None: w = "jpeg" return w diff --git a/requirements.txt b/requirements.txt index 9f27a10b..f93fe9c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,5 +21,5 @@ omegaconf easydict gradio==4.21.0 typer-config==1.4.0 - +filetype Pillow==9.5.0 # for AnyText