replace errors with warnings

This commit is contained in:
JM
2025-10-05 15:33:41 +03:00
parent b9ddf0ce37
commit c19c90d66e

View File

@@ -2496,7 +2496,7 @@ def load_image(image_path, alpha=False):
try:
with Image.open(image_path) as image:
if getattr(image, "is_animated", False):
raise Exception( f"{image_path} is animated" )
logger.warning( f"{image_path} is animated" )
# Convert image to sRGB
if "PIL.ImageCms" in sys.modules:
@@ -2508,7 +2508,7 @@ def load_image(image_path, alpha=False):
ImageCms.profileToProfile(image, src_profile, srgb_profile, inPlace=True)
image.info["icc_profile"] = ImageCms.ImageCmsProfile(srgb_profile).tobytes()
except Exception as e:
raise Exception( f"Could not convert {image_path} to sRGB: {src_profile.profile.model} {src_profile.profile.profile_description}\n{e}" )
logger.warning( f"Could not convert {image_path} to sRGB: {src_profile.profile.model} {src_profile.profile.profile_description}\n{e}" )
if alpha:
if not image.mode == "RGBA":