From 5eee5ed84fdb927ca496605827a253af3e6c5cab 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 c0515d378..dca76bb01 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -2207,10 +2207,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), "