From 745eb23a87b40707af9474ad732fc6d13b94628f Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 15 Apr 2024 22:22:40 +1000 Subject: [PATCH] Use LAB hopper file if conversion is not supported --- Tests/helper.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/helper.py b/Tests/helper.py index c1399e89b..680825d4b 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -273,7 +273,14 @@ def _cached_hopper(mode: str) -> Image.Image: im = hopper("L") else: im = hopper() - return im.convert(mode) + try: + im = im.convert(mode) + except ImportError: + if mode == "LAB": + im = Image.open("Tests/images/hopper.Lab.tif") + else: + raise + return im def djpeg_available() -> bool: