diff --git a/test/test-suite/test_foreign.py b/test/test-suite/test_foreign.py index 0e51bdbd..e4f847ba 100644 --- a/test/test-suite/test_foreign.py +++ b/test/test-suite/test_foreign.py @@ -374,10 +374,7 @@ class TestForeign: self.file_loader("tiffload", TIF4_FILE, tiff4_valid) - if pyvips.at_least_libvips(8, 5): - self.save_load_buffer("tiffsave_buffer", - "tiffload_buffer", - self.colour) + self.save_load_buffer("tiffsave_buffer", "tiffload_buffer", self.colour) self.save_load("%s.tif", self.mono) self.save_load("%s.tif", self.colour) self.save_load("%s.tif", self.cmyk) @@ -510,14 +507,14 @@ class TestForeign: assert a.height == b.height assert a.avg() == b.avg() - x = pyvips.Image.new_from_file(TIF_FILE) - buf = x.tiffsave_buffer(tile=True, pyramid=True, region_shrink="mean") - buf = x.tiffsave_buffer(tile=True, pyramid=True, region_shrink="mode") - buf = x.tiffsave_buffer(tile=True, pyramid=True, region_shrink="median") - buf = x.tiffsave_buffer(tile=True, pyramid=True, region_shrink="max") - buf = x.tiffsave_buffer(tile=True, pyramid=True, region_shrink="min") - buf = x.tiffsave_buffer(tile=True, pyramid=True, - region_shrink="nearest") + # just 0/255 in each band, shrink with mode and all pixels should be 0 + # or 255 in layer 1 + x = pyvips.Image.new_from_file(TIF_FILE) > 128 + for shrink in ["mode", "median", "max", "min"]: + buf = x.tiffsave_buffer(pyramid=True, region_shrink=shrink) + y = pyvips.Image.new_from_buffer(buf, "", page=1) + z = y.hist_find(band=0) + assert z(0, 0)[0] + z(255, 0)[0] == y.width * y.height @skip_if_no("magickload") def test_magickload(self):