check alpha on animation rects too

see https://github.com/libvips/libvips/issues/1351#issuecomment-506942104
This commit is contained in:
John Cupitt 2019-06-29 11:50:26 +01:00
parent 7d8b6d9d9f
commit d3cd51a8c3

View File

@ -493,11 +493,13 @@ read_header( Read *read, VipsImage *out )
vips_image_set_int( out, "gif-delay",
VIPS_RINT( read->delay / 10.0 ) );
/* If we find a frame which doesn't fill the canvas,
* we'll need to save as RGBA.
/* We need the alpha in an animation if:
* - any frame has transparent pixels
* - any frame doesn't fill the whole canvas.
*/
do {
if( iter.x_offset != 0 ||
if( iter.has_alpha ||
iter.x_offset != 0 ||
iter.y_offset != 0 ||
iter.width != read->canvas_width ||
iter.height != read->canvas_height ) {