fix: make gif-loop consistent between GIF and WEBP
This commit is contained in:
parent
063234fde1
commit
ab7ef2c2bc
@ -471,8 +471,11 @@ vips_foreign_load_gif_scan_application_ext( VipsForeignLoadGif *gif,
|
|||||||
if( have_netscape &&
|
if( have_netscape &&
|
||||||
extension &&
|
extension &&
|
||||||
extension[0] == 3 &&
|
extension[0] == 3 &&
|
||||||
extension[1] == 1 )
|
extension[1] == 1 ) {
|
||||||
gif->loop = extension[2] | (extension[3] << 8);
|
gif->loop = extension[2] | (extension[3] << 8);
|
||||||
|
if (gif->loop != 0)
|
||||||
|
gif->loop = gif->loop + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
@ -1142,7 +1145,7 @@ vips_foreign_load_gif_init( VipsForeignLoadGif *gif )
|
|||||||
gif->transparency = -1;
|
gif->transparency = -1;
|
||||||
gif->delays = NULL;
|
gif->delays = NULL;
|
||||||
gif->delays_length = 0;
|
gif->delays_length = 0;
|
||||||
gif->loop = 0;
|
gif->loop = 1;
|
||||||
gif->comment = NULL;
|
gif->comment = NULL;
|
||||||
gif->dispose = 0;
|
gif->dispose = 0;
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick )
|
|||||||
*/
|
*/
|
||||||
if( vips_image_get_typeof( im, "gif-loop" ) &&
|
if( vips_image_get_typeof( im, "gif-loop" ) &&
|
||||||
!vips_image_get_int( im, "gif-loop", &number ) )
|
!vips_image_get_int( im, "gif-loop", &number ) )
|
||||||
image->iterations = (size_t) (number ? number + 1 : 0);
|
image->iterations = (size_t) (number ? number : 0);
|
||||||
|
|
||||||
if( vips_image_get_typeof( im, "gif-comment" ) &&
|
if( vips_image_get_typeof( im, "gif-comment" ) &&
|
||||||
!vips_image_get_string( im, "gif-comment", &str ) )
|
!vips_image_get_string( im, "gif-comment", &str ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user