diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt index 91752afea326..306980686438 100644 --- a/lib/galaxy/dependencies/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pinned-requirements.txt @@ -86,6 +86,7 @@ h5py==3.11.0 ; python_version >= "3.8" and python_version < "3.9" h5py==3.12.1 ; python_version >= "3.9" and python_version < "3.13" humanfriendly==10.0 ; python_version >= "3.8" and python_version < "3.13" idna==3.10 ; python_version >= "3.8" and python_version < "3.13" +puremagic=1.28 ; python_version >= "3.8" and python_version < "3.13" importlib-metadata==8.5.0 ; python_version >= "3.8" and python_version < "3.13" importlib-resources==6.4.5 ; python_version >= "3.8" and python_version < "3.9" isa-rwval @ git+https://github.com/nsoranzo/isa-rwval.git@3d989181058d2765a93cb0e7ca85d6955e0eb6ef ; python_version >= "3.8" and python_version < "3.13" diff --git a/lib/galaxy/util/image_util.py b/lib/galaxy/util/image_util.py index 3b11a50d2fda..127b18df648f 100644 --- a/lib/galaxy/util/image_util.py +++ b/lib/galaxy/util/image_util.py @@ -7,6 +7,8 @@ Optional, ) +import puremagic + try: from PIL import Image except ImportError: @@ -26,7 +28,7 @@ def image_type(filename: str) -> Optional[str]: # exception we expect to happen frequently, so we're not logging pass if not fmt: - fmt = imghdr.what(filename) + fmt = puremagic.what(filename) if fmt: return fmt.upper() else: