mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-15 11:25:53 +08:00
Merge pull request #214 from cgohlke/patch-1
BUG: Fix io.imsave() problems with passing arguments to plugin "freeimage".
This commit is contained in:
committed by
Stefan van der Walt
parent
53426a0077
commit
a454930da8
@@ -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.')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user