revise formatting

This commit is contained in:
John Cupitt 2019-12-20 15:23:06 +00:00
parent ff2b934244
commit 9d05251f7e
1 changed files with 4 additions and 3 deletions

View File

@ -330,7 +330,7 @@ write_webp_anim( VipsWebPWrite *write, VipsImage *image, int page_height )
/* New images have an array of ints instead. /* New images have an array of ints instead.
*/ */
delay_length = 0; delay = NULL;
if( vips_image_get_typeof( image, "delay" ) && if( vips_image_get_typeof( image, "delay" ) &&
vips_image_get_array_int( image, "delay", vips_image_get_array_int( image, "delay",
&delay, &delay_length ) ) &delay, &delay_length ) )
@ -364,13 +364,14 @@ write_webp_anim( VipsWebPWrite *write, VipsImage *image, int page_height )
WebPPictureFree( &pic ); WebPPictureFree( &pic );
page_index = top / page_height; page_index = top / page_height;
if( page_index < delay_length ) if( delay &&
page_index < delay_length )
timestamp_ms += delay[page_index]; timestamp_ms += delay[page_index];
else else
timestamp_ms += gif_delay * 10; timestamp_ms += gif_delay * 10;
} }
/* Closes encoder and add last frame delay. /* Closes encoder and adds last frame delay.
*/ */
if( !WebPAnimEncoderAdd( write->enc, if( !WebPAnimEncoderAdd( write->enc,
NULL, timestamp_ms, NULL ) ) { NULL, timestamp_ms, NULL ) ) {