Skip to content

Commit

Permalink
Use LAB hopper file if conversion is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Apr 15, 2024
1 parent 651039a commit 8af36ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8af36ce

Please sign in to comment.