diff --git a/Tests/test_numpy.py b/Tests/test_numpy.py index 5f8097ef8..b9cacf0bb 100644 --- a/Tests/test_numpy.py +++ b/Tests/test_numpy.py @@ -54,3 +54,11 @@ def test_numpy_to_image(): assert_image(to_image(numpy.uint8, 3), "RGB", (10, 10)) assert_image(to_image(numpy.uint8, 4), "RGBA", (10, 10)) + + +# based on an erring example at http://is.gd/6F0esS +def test_3d_array(): + a = numpy.ones((10, 10, 10), dtype=numpy.uint8) + assert_image(Image.fromarray(a[1, :, :]), "L", (10, 10)) + assert_image(Image.fromarray(a[:, 1, :]), "L", (10, 10)) + assert_image(Image.fromarray(a[:, :, 1]), "L", (10, 10))