diff --git a/TODO b/TODO index c3563c1a..1ba428b8 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -- tests for band fold/unfold with factor - - how about something like vips_grid() which turns a tall thin one-band image into a much smaller many-band image? diff --git a/test/test_conversion.py b/test/test_conversion.py index 18fa9865..91e4b419 100755 --- a/test/test_conversion.py +++ b/test/test_conversion.py @@ -237,6 +237,15 @@ class TestConversion(unittest.TestCase): self.assertEqual(y.bands, 1) self.assertEqual(x.avg(), y.avg()) + x = self.mono.bandfold(factor = 2) + self.assertEqual(x.width, self.mono.width / 2) + self.assertEqual(x.bands, 2) + + y = x.bandunfold(factor = 2) + self.assertEqual(y.width, self.mono.width) + self.assertEqual(y.bands, 1) + self.assertEqual(x.avg(), y.avg()) + def test_byteswap(self): x = self.mono.cast("ushort") y = x.byteswap().byteswap()