Support converting between I;16N and L

This commit is contained in:
Andrew Murray 2022-12-28 17:16:44 +11:00
parent 2755e0ffaa
commit 700a8e98da
2 changed files with 11 additions and 7 deletions

View File

@ -90,10 +90,7 @@ def test_convert():
im = original.copy()
verify(im.convert("I;16"))
verify(im.convert("I;16").convert("L"))
verify(im.convert("I;16").convert("I"))
verify(im.convert("I;16B"))
verify(im.convert("I;16B").convert("L"))
verify(im.convert("I;16B").convert("I"))
for mode in ("I;16", "I;16B", "I;16N"):
verify(im.convert(mode))
verify(im.convert(mode).convert("L"))
verify(im.convert(mode).convert("I"))

View File

@ -970,6 +970,13 @@ static struct {
{"I;16L", "L", I16L_L},
{"L", "I;16B", L_I16B},
{"I;16B", "L", I16B_L},
#ifdef WORDS_BIGENDIAN
{"L", "I;16N", L_I16B},
{"I;16N", "L", I16B_L},
#else
{"L", "I;16N", L_I16L},
{"I;16N", "L", I16L_L},
#endif
{"I;16", "F", I16L_F},
{"I;16L", "F", I16L_F},