From 0320815b9e0611774424b9eb868ccb9d47f75142 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Fri, 14 May 2010 13:53:11 +0200 Subject: [PATCH] Fix freeimage loading via array interface. --- scikits/image/io/_plugins/freeimage_plugin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scikits/image/io/_plugins/freeimage_plugin.py b/scikits/image/io/_plugins/freeimage_plugin.py index bc5ca18e..b6ab98a5 100644 --- a/scikits/image/io/_plugins/freeimage_plugin.py +++ b/scikits/image/io/_plugins/freeimage_plugin.py @@ -300,12 +300,12 @@ def _wrap_bitmap_bits_in_array(bitmap, shape, dtype): 'data': (bits, True), 'strides': strides, 'typestr': '|u1', - 'shape': shape, + 'shape': tuple(shape), } # Still segfaulting on 64-bit machine because of illegal memory access - return array(DummyArray()) + return numpy.array(DummyArray()) def _array_from_bitmap(bitmap): """Convert a FreeImage bitmap pointer to a numpy array @@ -323,8 +323,7 @@ def _array_from_bitmap(bitmap): array[2] = b array = array[..., ::-1] - if len(shape) == 3: - array = numpy.rollaxis(array, 0, 3) + array = array.T return array.copy()