diff --git a/src/wireviz/wv_helper.py b/src/wireviz/wv_helper.py index 5535ce7..32b8fb6 100644 --- a/src/wireviz/wv_helper.py +++ b/src/wireviz/wv_helper.py @@ -165,11 +165,10 @@ def aspect_ratio(image_src): image = Image.open(image_src) if image.width > 0 and image.height > 0: return image.width / image.height - print(f'aspect_ratio(): image size is {image.width} x {image.height}') - except ModuleNotFoundError as error: - print(f'aspect_ratio(): {error}') - except FileNotFoundError as error: - print(f'aspect_ratio(): {error}') + print(f'aspect_ratio(): Invalid image size {image.width} x {image.height}') + # ModuleNotFoundError and FileNotFoundError are the most expected, but all are handled equally. + except Exception as error: + print(f'aspect_ratio(): {type(error).__name__}: {error}') return 1 # Assume 1:1 when unable to read actual image size