diff --git a/skimage/io/_plugins/freeimage_plugin.py b/skimage/io/_plugins/freeimage_plugin.py index 5d023909..9cb9c467 100644 --- a/skimage/io/_plugins/freeimage_plugin.py +++ b/skimage/io/_plugins/freeimage_plugin.py @@ -153,20 +153,20 @@ class FI_TYPES(object): } fi_types = { - (numpy.uint8, 1): FIT_BITMAP, - (numpy.uint8, 3): FIT_BITMAP, - (numpy.uint8, 4): FIT_BITMAP, - (numpy.uint16, 1): FIT_UINT16, - (numpy.int16, 1): FIT_INT16, - (numpy.uint32, 1): FIT_UINT32, - (numpy.int32, 1): FIT_INT32, - (numpy.float32, 1): FIT_FLOAT, - (numpy.float64, 1): FIT_DOUBLE, - (numpy.complex128, 1): FIT_COMPLEX, - (numpy.uint16, 3): FIT_RGB16, - (numpy.uint16, 4): FIT_RGBA16, - (numpy.float32, 3): FIT_RGBF, - (numpy.float32, 4): FIT_RGBAF + (numpy.dtype('uint8'), 1): FIT_BITMAP, + (numpy.dtype('uint8'), 3): FIT_BITMAP, + (numpy.dtype('uint8'), 4): FIT_BITMAP, + (numpy.dtype('uint16'), 1): FIT_UINT16, + (numpy.dtype('int16'), 1): FIT_INT16, + (numpy.dtype('uint32'), 1): FIT_UINT32, + (numpy.dtype('int32'), 1): FIT_INT32, + (numpy.dtype('float32'), 1): FIT_FLOAT, + (numpy.dtype('float64'), 1): FIT_DOUBLE, + (numpy.dtype('complex128'), 1): FIT_COMPLEX, + (numpy.dtype('uint16'), 3): FIT_RGB16, + (numpy.dtype('uint16'), 4): FIT_RGBA16, + (numpy.dtype('float32'), 3): FIT_RGBF, + (numpy.dtype('float32'), 4): FIT_RGBAF } extra_dims = { @@ -608,7 +608,7 @@ def _array_to_bitmap(array): else: n_channels = shape[0] try: - fi_type = FI_TYPES.fi_types[(dtype.type, n_channels)] + fi_type = FI_TYPES.fi_types[(dtype, n_channels)] except KeyError: raise ValueError('Cannot write arrays of given type and shape.')