bump min libwebpmux version

0.3 can't read 0.5 libwebp files argh
This commit is contained in:
John Cupitt 2016-11-10 09:20:54 +00:00
parent bf7f1cd9a4
commit 5cc9229882
4 changed files with 19 additions and 10 deletions

4
TODO
View File

@ -1,6 +1,4 @@
- test with libwebp 0.3, the earliest that supports libwebpmux
test under valgrind
- test under valgrind
- not sure about utf8 error messages on win

View File

@ -783,8 +783,12 @@ if test x"$with_libwebp" != "xno"; then
fi
# webp has the stuff for pulling out ICC profile etc in a separate library
#
# we can build with libwebpmux back to 0.3, but it's not until libwebp 0.5 that
# we can read that metadata back successfully ... insist on 0.5 so that tests
# can work smoothly
if test x"$with_libwebp" != "xno"; then
PKG_CHECK_MODULES(LIBWEBPMUX, libwebpmux >= 0.3.0,
PKG_CHECK_MODULES(LIBWEBPMUX, libwebpmux >= 0.5.0,
[AC_DEFINE(HAVE_LIBWEBPMUX,1,[define if you have libwebpmux installed.])
with_libwebpmux=yes
PACKAGES_USED="$PACKAGES_USED libwebpmux"

View File

@ -237,12 +237,15 @@ read_header( Read *read, VipsImage *out )
int i;
/* We have to parse the whole file again to get the metadata out.
*
* Don't make parse failure an error. We don't want to refuse to read
* any pixels because of some malformed metadata.
*/
bitstream.bytes = read->data;
bitstream.size = read->length;
if( !(mux = WebPMuxCreate( &bitstream, 0 )) ) {
vips_error( "webp", "%s", _( "parse error" ) );
return( -1 );
vips_warn( "webp", "%s", _( "unable to read image metadata" ) );
return( 0 );
}
for( i = 0; i < vips__n_webp_names; i++ ) {
@ -288,8 +291,10 @@ vips__webp_read_file_header( const char *filename, VipsImage *out, int shrink )
return( -1 );
}
if( read_header( read, out ) )
if( read_header( read, out ) ) {
read_free( read );
return( -1 );
}
read_free( read );
@ -356,8 +361,10 @@ vips__webp_read_buffer_header( const void *buf, size_t len, VipsImage *out,
return( -1 );
}
if( read_header( read, out ) )
if( read_header( read, out ) ) {
read_free( read );
return( -1 );
}
read_free( read );

View File

@ -372,8 +372,8 @@ class TestForeign(unittest.TestCase):
self.file_loader("webpload", self.webp_file, webp_valid)
self.buffer_loader("webpload_buffer", self.webp_file, webp_valid)
self.save_load_buffer("webpsave_buffer", "webpload_buffer", self.colour,
50)
self.save_load_buffer("webpsave_buffer", "webpload_buffer",
self.colour, 60)
self.save_load("%s.webp", self.colour)
# test lossless mode