Merge branch '8.10'

This commit is contained in:
John Cupitt 2020-12-18 10:14:03 +00:00
commit 2348a02351
5 changed files with 14 additions and 4 deletions

View File

@ -10,6 +10,9 @@
- add _source load support for pdfium
- add "seed" param to perlin, worley and gaussnoise
18/12/20 started 8.10.5
- fix potential /0 in animated webp load [lovell]
14/12/20 started 8.10.4
- fix spng detection

View File

@ -260,9 +260,9 @@ blend_pixel( guint32 A, guint32 B )
guint8 aB = getA( B );
guint8 fac = (aB * (256 - aA) + 128) >> 8;
guint8 fac = (aB * (255 - aA) + 127) >> 8;
guint8 aR = aA + fac;
int scale = (1 << 24) / aR;
int scale = aR == 0 ? 0 : (1 << 24) / aR;
guint8 rR = BLEND( getR( A ), aA, getR( B ), fac, scale );
guint8 gR = BLEND( getG( A ), aA, getG( B ), fac, scale );

View File

@ -22,6 +22,7 @@ ANALYZE_FILE = os.path.join(IMAGES, "t00740_tr1_segm.hdr")
GIF_FILE = os.path.join(IMAGES, "cramps.gif")
WEBP_FILE = os.path.join(IMAGES, "1.webp")
WEBP_LOOKS_LIKE_SVG_FILE = os.path.join(IMAGES, "looks-like-svg.webp")
WEBP_ANIMATED_FILE = os.path.join(IMAGES, "big-height.webp")
EXR_FILE = os.path.join(IMAGES, "sample.exr")
FITS_FILE = os.path.join(IMAGES, "WFPC2u5780205r_c0fx.fits")
OPENSLIDE_FILE = os.path.join(IMAGES, "CMU-1-Small-Region.svs")

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -17,8 +17,8 @@ from helpers import \
GIF_ANIM_DISPOSE_PREVIOUS_FILE, \
GIF_ANIM_DISPOSE_PREVIOUS_EXPECTED_PNG_FILE, \
temp_filename, assert_almost_equal_objects, have, skip_if_no, \
TIF1_FILE, TIF2_FILE, TIF4_FILE, WEBP_LOOKS_LIKE_SVG_FILE
TIF1_FILE, TIF2_FILE, TIF4_FILE, WEBP_LOOKS_LIKE_SVG_FILE, \
WEBP_ANIMATED_FILE
class TestForeign:
tempdir = None
@ -694,6 +694,12 @@ class TestForeign:
x = pyvips.Image.new_from_file(WEBP_LOOKS_LIKE_SVG_FILE)
assert x.get("vips-loader") == "webpload"
# Animated WebP roundtrip
x = pyvips.Image.new_from_file(WEBP_ANIMATED_FILE, n=-1)
assert x.width == 13
assert x.height == 16393
buf = x.webpsave_buffer()
@skip_if_no("analyzeload")
def test_analyzeload(self):
def analyze_valid(im):