From c19c90d66e6c39bb160c01124318cb1f84a45c77 Mon Sep 17 00:00:00 2001 From: JM Date: Sun, 5 Oct 2025 15:33:41 +0300 Subject: [PATCH] replace errors with warnings --- library/train_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/train_util.py b/library/train_util.py index c1b02b8c..33af29f2 100644 --- a/library/train_util.py +++ b/library/train_util.py @@ -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":