From 7d5856bdf7f9b41f8ae55f395d61e28e976cc610 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Mon, 11 Apr 2016 11:33:41 -0700 Subject: [PATCH] Corrects fromarray() datatype mapping for integer datatypes. Currently failing for int16LE as of this commit. --- PIL/Image.py | 12 ++++++++---- Tests/test_numpy.py | 19 ++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/PIL/Image.py b/PIL/Image.py index 2341daff0..64f461358 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -2210,10 +2210,14 @@ _fromarray_typemap = { # ((1, 1), "|b1"): ("1", "1"), # broken ((1, 1), "|u1"): ("L", "L"), ((1, 1), "|i1"): ("I", "I;8"), - ((1, 1), "i2"): ("I", "I;16B"), - ((1, 1), "i4"): ("I", "I;32B"), + ((1, 1), "u2"): ("I", "I;16B"), + ((1, 1), "i2"): ("I", "I;16BS"), + ((1, 1), "u4"): ("I", "I;32B"), + ((1, 1), "i4"): ("I", "I;32BS"), ((1, 1), "f4"): ("F", "F;32BF"), ((1, 1), "