Use LAB hopper file if conversion is not supported

This commit is contained in:
Andrew Murray 2024-04-15 22:22:40 +10:00
parent eee633cb21
commit 745eb23a87

View File

@ -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: