Merge branch '8.10'

This commit is contained in:
John Cupitt 2020-11-03 23:45:17 +00:00
commit 20988977ab
3 changed files with 12 additions and 13 deletions

View File

@ -15,6 +15,7 @@
- fix vips7 webp load [barryspearce]
- fix out of bounds exif read in heifload
- fix out of bounds read in tiffload
- fix tiffsave region shrink mode [imgifty]
6/9/20 started 8.10.2
- update magicksave/load profile handling [kelilevi]

View File

@ -1629,7 +1629,8 @@ layer_strip_shrink( Layer *layer )
if( vips_rect_isempty( &target ) )
break;
(void) vips_region_shrink( from, to, &target );
(void) vips_region_shrink_method( from, to, &target,
layer->wtiff->region_shrink );
below->write_y += target.height;

View File

@ -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):