From 078ed488c8703c103fda1bac3513c8b5b4218095 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Fri, 3 Feb 2012 15:46:43 -0500 Subject: [PATCH] Fix casting error when converting from int8 to uint16. This error only comes up in development versions of numpy, which refuses to cast the input to the correct type for inplace operations. --- skimage/util/dtype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/util/dtype.py b/skimage/util/dtype.py index da2ff5e7..11199cc8 100644 --- a/skimage/util/dtype.py +++ b/skimage/util/dtype.py @@ -120,7 +120,7 @@ def _convert(image, dtype): # int8 -> uint32 image = dtype(image) image *= 2**16 + 2**8 + 1 - result += image + result += dtype(image) return result if kind == 'i': # signed integer -> signed integer