From 12ad6e8cbfa2a9bb0a6fbf4c0fdf5b9a044f4800 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 5 Mar 2015 08:41:18 -0500 Subject: [PATCH] Fresh upstream release - includes slicing-error.patch freeimage-fix.patch --- debian/changelog | 7 +++ debian/patches/freeimage-fix.patch | 77 ------------------------------ debian/patches/series | 2 - debian/patches/slicing-error.patch | 19 -------- 4 files changed, 7 insertions(+), 98 deletions(-) delete mode 100644 debian/patches/freeimage-fix.patch delete mode 100644 debian/patches/slicing-error.patch diff --git a/debian/changelog b/debian/changelog index e306abd6..08cb9d0b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +skimage (0.11.0-1) experimental; urgency=medium + + * Fresh upstream release + - includes slicing-error.patch freeimage-fix.patch + + -- Yaroslav Halchenko Thu, 05 Mar 2015 08:32:02 -0500 + skimage (0.10.1-2) unstable; urgency=medium * build with -fsigned-char to fix test failures on unsigned ports diff --git a/debian/patches/freeimage-fix.patch b/debian/patches/freeimage-fix.patch deleted file mode 100644 index bc5846c2..00000000 --- a/debian/patches/freeimage-fix.patch +++ /dev/null @@ -1,77 +0,0 @@ -Author: Stefan van der Walt -Description: freeimage: Correctly handle saving uint16 images and fix big endian - -Origin: 2b1dde20 051c54c577b3 84f3835106aaeb -Applied-Upstream: 0.11 ---- a/skimage/io/_plugins/freeimage_plugin.py -+++ b/skimage/io/_plugins/freeimage_plugin.py -@@ -493,7 +493,6 @@ def _array_from_bitmap(bitmap): - # swizzle the color components and flip the scanlines to go from - # FreeImage's BGR[A] and upside-down internal memory format to something - # more normal -- - def n(arr): - return arr[..., ::-1].T - if len(shape) == 3 and _FI.FreeImage_IsLittleEndian() and \ -@@ -637,17 +636,28 @@ def _array_to_bitmap(array): - raise RuntimeError('Could not allocate image for storage') - try: - def n(arr): # normalise to freeimage's in-memory format -- return arr.T[:, ::-1] -+ return arr.T[..., ::-1] -+ - wrapped_array = _wrap_bitmap_bits_in_array(bitmap, w_shape, dtype) - # swizzle the color components and flip the scanlines to go to - # FreeImage's BGR[A] and upside-down internal memory format -- if len(shape) == 3 and _FI.FreeImage_IsLittleEndian() and \ -- dtype.type == numpy.uint8: -- wrapped_array[0] = n(array[:, :, 2]) -- wrapped_array[1] = n(array[:, :, 1]) -- wrapped_array[2] = n(array[:, :, 0]) -+ if len(shape) == 3 and _FI.FreeImage_IsLittleEndian(): -+ R = array[:, :, 0] -+ G = array[:, :, 1] -+ B = array[:, :, 2] -+ -+ if dtype.type == numpy.uint8: -+ wrapped_array[0] = n(B) -+ wrapped_array[1] = n(G) -+ wrapped_array[2] = n(R) -+ elif dtype.type == numpy.uint16: -+ wrapped_array[0] = n(R) -+ wrapped_array[1] = n(G) -+ wrapped_array[2] = n(B) -+ - if shape[2] == 4: -- wrapped_array[3] = n(array[:, :, 3]) -+ A = array[:, :, 3] -+ wrapped_array[3] = n(A) - else: - wrapped_array[:] = n(array) - if len(shape) == 2 and dtype.type == numpy.uint8: -diff --git a/skimage/io/tests/test_freeimage.py b/skimage/io/tests/test_freeimage.py -index 32e01bd..308f1ee 100644 ---- a/skimage/io/tests/test_freeimage.py -+++ b/skimage/io/tests/test_freeimage.py -@@ -74,15 +74,15 @@ class TestSave: - f.close() - sio.imsave(fname, x) - y = sio.imread(fname) -- assert_array_equal(x, y) -+ assert_array_equal(y, x) - - @skipif(not FI_available) - def test_imsave_roundtrip(self): - for shape, dtype, format in [ - [(10, 10), (np.uint8, np.uint16), ('tif', 'png')], - [(10, 10), (np.float32,), ('tif',)], -- [(10, 10, 3), (np.uint8,), ('png',)], -- [(10, 10, 4), (np.uint8,), ('png',)] -+ [(10, 10, 3), (np.uint8, np.uint16), ('png',)], -+ [(10, 10, 4), (np.uint8, np.uint16), ('png',)] - ]: - tests = [(d, f) for d in dtype for f in format] - for d, f in tests: --- -1.9.1 - diff --git a/debian/patches/series b/debian/patches/series index 0e42339f..88383925 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,5 +1,3 @@ search-html.patch fix-doc-links.patch doc-privacy.patch -slicing-error.patch -freeimage-fix.patch diff --git a/debian/patches/slicing-error.patch b/debian/patches/slicing-error.patch deleted file mode 100644 index eebeb0f4..00000000 --- a/debian/patches/slicing-error.patch +++ /dev/null @@ -1,19 +0,0 @@ -Description: Fix slicing error revealed by numpy 1.9.0. - Numpy 1.9.0 no longer allows oversize data to be assigned to a - boolean indexed 1-d array by discarding excess elements. -Author: Charles Harris -Origin: 7a074d5dd165536cb05fd87ea94a29510edac1a7 -Date: Fri, 4 Jul 2014 20:04:32 -0600 -Bug: https://github.com/scikit-image/scikit-image/issues/1050 - ---- a/skimage/segmentation/_join.py -+++ b/skimage/segmentation/_join.py -@@ -124,7 +124,7 @@ def relabel_sequential(label_field, offs - if m == len(labels0): # nothing to do, already 1...n labels - return label_field, labels, labels - forward_map = np.zeros(m + 1, int) -- forward_map[labels0] = np.arange(offset, offset + len(labels0) + 1) -+ forward_map[labels0] = np.arange(offset, offset + len(labels0)) - if not (labels == 0).any(): - labels = np.concatenate(([0], labels)) - inverse_map = np.zeros(offset - 1 + len(labels), dtype=np.intp)