Permalink
Browse files

add animated webp tests

  • Loading branch information...
jcupitt committed Nov 27, 2018
1 parent 4e18244 commit 24abbb83ab307913bc4b3a4208c6305db36b351e
Showing with 15 additions and 3 deletions.
  1. +3 −3 libvips/foreign/vips2webp.c
  2. +12 −0 test/test-suite/test_foreign.py
@@ -42,9 +42,9 @@
*/
/*
*/
#define DEBUG
#define VIPS_DEBUG
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -432,8 +432,8 @@ vips_webp_add_chunks( VipsWebPWrite *write, VipsImage *image )
{
int i;
if( vips_image_get_typeof( image, "gif-count" ) )
vips_webp_set_count( write, get_int( image, "gif-count", 0 ) );
if( vips_image_get_typeof( image, "gif-loop" ) )
vips_webp_set_count( write, get_int( image, "gif-loop", 0 ) );
for( i = 0; i < vips__n_webp_names; i++ ) {
const char *vips_name = vips__webp_names[i].vips;
@@ -492,6 +492,18 @@ def webp_valid(im):
y = pyvips.Image.new_from_buffer(buf, "")
assert y.get("orientation") == 6
# try converting an animated gif to webp ... can't do back to gif
# again without IM support
if have("gifload"):
x1 = pyvips.Image.new_from_file(GIF_ANIM_FILE, n=-1)
w1 = x1.webpsave_buffer(Q=10)
x2 = pyvips.Image.new_from_buffer(w1, "", n=-1)
assert x1.width == x2.width
assert x1.height == x2.height
assert x1.get("gif-delay") == x2.get("gif-delay")
assert x1.get("page-height") == x2.get("page-height")
assert x1.get("gif-loop") == x2.get("gif-loop")
@skip_if_no("analyzeload")
def test_analyzeload(self):
def analyze_valid(im):

0 comments on commit 24abbb8

Please sign in to comment.