Skip to content

Commit 745eb23

Browse files
committed
Use LAB hopper file if conversion is not supported
1 parent eee633c commit 745eb23

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Tests/helper.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,14 @@ def _cached_hopper(mode: str) -> Image.Image:
273273
im = hopper("L")
274274
else:
275275
im = hopper()
276-
return im.convert(mode)
276+
try:
277+
im = im.convert(mode)
278+
except ImportError:
279+
if mode == "LAB":
280+
im = Image.open("Tests/images/hopper.Lab.tif")
281+
else:
282+
raise
283+
return im
277284

278285

279286
def djpeg_available() -> bool:

0 commit comments

Comments
 (0)