From 300dfcf4a4426e3b8beb26c26ff60e7df18e63a1 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Wed, 16 Aug 2017 11:46:27 -0700 Subject: [PATCH] Test/fix for issue #2044 --- PIL/Image.py | 2 +- Tests/test_numpy.py | 16 ++++++++++++---- libImaging/Unpack.c | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/PIL/Image.py b/PIL/Image.py index fd96a797f..e6ae18517 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -2423,7 +2423,7 @@ def fromqpixmap(im): _fromarray_typemap = { # (shape, typestr) => mode, rawmode # first two members of shape are set to one - # ((1, 1), "|b1"): ("1", "1"), # broken + ((1, 1), "|b1"): ("1", "1;8"), ((1, 1), "|u1"): ("L", "L"), ((1, 1), "|i1"): ("I", "I;8"), ((1, 1), " 0 ? 255 : 0; + } +} + + /* Unpack to "L" image */ @@ -1168,6 +1181,7 @@ static struct { {"1", "1;I", 1, unpack1I}, {"1", "1;R", 1, unpack1R}, {"1", "1;IR", 1, unpack1IR}, + {"1", "1;8", 1, unpack18}, /* greyscale */ {"L", "L;2", 2, unpackL2},