clear gif pages before load

some gifs may not clear the background, so we must init pages as 0

see https://github.com/lovell/sharp/issues/1331
This commit is contained in:
John Cupitt 2018-08-13 17:30:54 +01:00
parent 9a5249ca20
commit 01b66f5ccd
1 changed files with 9 additions and 0 deletions

View File

@ -18,6 +18,8 @@
* 21/11/17
* - add "gif-delay", "gif-loop", "gif-comment" metadata
* - add dispose handling
* 13/8/18
* - init pages to 0 before load
*/
/*
@ -779,6 +781,13 @@ vips_foreign_load_gif_new_page( VipsForeignLoadGif *gif )
return( NULL );
}
/* Some GIFs may not clear the background, so we must start
* transparent.
*/
memset( VIPS_IMAGE_ADDR( out, 0, 0 ),
0,
VIPS_IMAGE_SIZEOF_IMAGE( out ) );
return( out );
}