support "RGBa" and "La" in hopper() test helper

This commit is contained in:
Yay295 2022-12-25 18:41:21 -06:00
parent 9ad22fc96a
commit 87ed513f91

View File

@ -261,7 +261,11 @@ def hopper(mode: str | None = None, cache: dict[str, Image.Image] = {}) -> Image
# (for fast, isolated, repeatable tests).
im = cache.get(mode)
if im is None:
if mode == "F":
if mode == "RGBa":
im = hopper("RGBA").convert(mode)
elif mode == "La":
im = hopper("LA").convert(mode)
elif mode == "F":
im = hopper("L").convert(mode)
elif mode[:4] == "I;16":
im = hopper("I").convert(mode)