From e908e10aab5a40caec9988644640382d8e7d2631 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 28 Dec 2022 17:25:28 +1100 Subject: [PATCH] Support packing I;16N --- Tests/test_lib_pack.py | 3 +++ src/libImaging/Pack.c | 1 + 2 files changed, 4 insertions(+) diff --git a/Tests/test_lib_pack.py b/Tests/test_lib_pack.py index 979806cae..dc5bbb77b 100644 --- a/Tests/test_lib_pack.py +++ b/Tests/test_lib_pack.py @@ -207,6 +207,9 @@ class TestLibPack: 0x01000083, ) + def test_I16(self): + self.assert_pack("I;16N", "I;16N", 2, 0x0201, 0x0403, 0x0605) + def test_F_float(self): self.assert_pack("F", "F;32F", 4, 1.539989614439558e-36, 4.063216068939723e-34) diff --git a/src/libImaging/Pack.c b/src/libImaging/Pack.c index 01760e742..14c8f1461 100644 --- a/src/libImaging/Pack.c +++ b/src/libImaging/Pack.c @@ -664,6 +664,7 @@ static struct { #endif {"I;16B", "I;16B", 16, copy2}, {"I;16L", "I;16L", 16, copy2}, + {"I;16N", "I;16N", 16, copy2}, {"I;16", "I;16N", 16, packI16N_I16}, // LibTiff native->image endian. {"I;16L", "I;16N", 16, packI16N_I16}, {"I;16B", "I;16N", 16, packI16N_I16B},