diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt index 91752afea326..325ecb44595f 100644 --- a/lib/galaxy/dependencies/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pinned-requirements.txt @@ -133,6 +133,7 @@ propcache==0.2.0 ; python_version >= "3.8" and python_version < "3.13" prov==1.5.1 ; python_version >= "3.8" and python_version < "3.13" psutil==6.1.0 ; python_version >= "3.8" and python_version < "3.13" pulsar-galaxy-lib==0.15.6 ; python_version >= "3.8" and python_version < "3.13" +puremagic==1.28 ; python_version >= "3.8" and python_version < "3.13" pycparser==2.22 ; python_version >= "3.8" and python_version < "3.13" pycryptodome==3.21.0 ; python_version >= "3.8" and python_version < "3.13" pydantic-core==2.23.4 ; 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..7d867525dfb8 100644 --- a/lib/galaxy/util/image_util.py +++ b/lib/galaxy/util/image_util.py @@ -1,12 +1,13 @@ """Provides utilities for working with image files.""" -import imghdr import logging from typing import ( List, Optional, ) +import puremagic + try: from PIL import Image except ImportError: @@ -26,7 +27,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: