diff --git a/CHANGES.rst b/CHANGES.rst index b72e5a307..8dedfe866 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,12 @@ Changelog (Pillow) 4.3.0 (unreleased) ------------------ +- Basic support for Termux (android) in setup.py #2684 + [wiredfool] + +- Bug: Fix Image.fromarray for numpy.bool type. #2683 + [wiredfool] + - CI: Add Fedora 24 and 26 to Docker tests [wiredfool] @@ -31,6 +37,9 @@ Changelog (Pillow) - Remove unused im.copy2 and core.copy methods #2657 [homm] +- Fast Image.merge() #2677 + [homm] + - Fast Image.split() #2676 [homm] diff --git a/PIL/Image.py b/PIL/Image.py index 5228411e1..75ae4e796 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 */ @@ -1244,6 +1257,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}, diff --git a/setup.py b/setup.py index 1cbfc259a..f378362e6 100755 --- a/setup.py +++ b/setup.py @@ -365,6 +365,14 @@ class pil_build_ext(build_ext): # work ;-) self.add_multiarch_paths() + # termux support for android. + # system libraries (zlib) are installed in /system/lib + # headers are at $PREFIX/include + # user libs are at $PREFIX/lib + if os.environ.get('ANDROID_ROOT', None): + _add_directory(library_dirs, + os.path.join(os.environ['ANDROID_ROOT'],'lib')) + elif sys.platform.startswith("gnu"): self.add_multiarch_paths()