mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-14 08:21:46 +00:00
replace errors with warnings
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user