add more info to the error message for #15567

This commit is contained in:
AUTOMATIC1111 2024-04-21 07:18:58 +03:00
parent 367b823466
commit 6f4f6bff6b

View File

@ -1,5 +1,6 @@
import base64
import json
import os.path
import warnings
import logging
@ -117,7 +118,7 @@ def extract_image_data_embed(image):
outarr = crop_black(np.array(image.convert('RGB').getdata()).reshape(image.size[1], image.size[0], d).astype(np.uint8)) & 0x0F
black_cols = np.where(np.sum(outarr, axis=(0, 2)) == 0)
if black_cols[0].shape[0] < 2:
logger.debug('No Image data blocks found.')
logger.debug(f'{os.path.basename(getattr(image, "filename", "unknown image file"))}: no embedded information found.')
return None
data_block_lower = outarr[:, :black_cols[0].min(), :].astype(np.uint8)