better gif-loop handling (again)
setting loops to 0 was broken
This commit is contained in:
parent
522ddc1430
commit
ea9e477ad3
@ -143,12 +143,18 @@ vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick )
|
||||
!vips_image_get_int( im, "gif-delay", &number ) )
|
||||
image->delay = (size_t) number;
|
||||
|
||||
/* ImageMagick uses 0 to mean unset, so we must always add 1. See
|
||||
* coders/gif.c.
|
||||
/* ImageMagick uses iterations like this (at least in gif save):
|
||||
* 0 - set 0 loops (infinite)
|
||||
* 1 - don't write the netscape extension block
|
||||
* 2 - loop once
|
||||
* 3 - loop twice etc.
|
||||
*
|
||||
* We have the simple gif meaning, so we must add one unless it's
|
||||
* zero.
|
||||
*/
|
||||
if( vips_image_get_typeof( im, "gif-loop" ) &&
|
||||
!vips_image_get_int( im, "gif-loop", &number ) )
|
||||
image->iterations = (size_t) (number + 1);
|
||||
image->iterations = (size_t) (number ? number + 1 : 0);
|
||||
|
||||
if( vips_image_get_typeof( im, "gif-comment" ) &&
|
||||
!vips_image_get_string( im, "gif-comment", &str ) )
|
||||
|
Loading…
Reference in New Issue
Block a user