Skip to content
Permalink
Browse files

small changes to the gif-loop fix

see #1362
  • Loading branch information
jcupitt committed Dec 18, 2019
1 parent 501fc38 commit 4616cf1f5c23a5d7adc6331e96abccf4564576dc
Showing with 26 additions and 9 deletions.
  1. +17 −3 .editorconfig
  2. +2 −2 libvips/foreign/gifload.c
  3. +3 −2 libvips/foreign/magicksave.c
  4. +2 −1 libvips/foreign/webp2vips.c
  5. +2 −1 libvips/iofuncs/header.c
@@ -1,9 +1,23 @@
# http://editorconfig.org
root = true

[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true

[*.{cpp,c,h}]
indent_style = tab
indent_size = 8

[*.py]
indent_style = space
indent_size = 4

[Makefile.am]
indent_style = tab
indent_size = 8

[configure.ac]
indent_style = space
indent_size = 2
@@ -574,8 +574,8 @@ vips_foreign_load_gif_scan_application_ext( VipsForeignLoadGif *gif,
extension[0] == 3 &&
extension[1] == 1 ) {
gif->loop = extension[2] | (extension[3] << 8);
if (gif->loop != 0)
gif->loop = gif->loop + 1;
if( gif->loop != 0 )
gif->loop += 1;
}
}

@@ -170,12 +170,13 @@ vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick )
*/
if( vips_image_get_typeof( im, "loop" ) &&
!vips_image_get_int( im, "loop", &number ) ) {
image->iterations = (size_t) (number ? number : 0);
image->iterations = (size_t) number;
}
else {
/* DEPRECATED "gif-loop"
*
* We have the simple gif meaning, so we must add one unless it's zero.
* 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 ) )
@@ -439,7 +439,8 @@ read_header( Read *read, VipsImage *out )
* Not the correct behavior as loop=1 became gif-loop=0
* but we want to keep the old behavior untouched!
*/
vips_image_set_int( out, "gif-loop", loop_count == 0 ? 0 : loop_count - 1 );
vips_image_set_int( out, "gif-loop",
loop_count == 0 ? 0 : loop_count - 1 );

vips_image_set_int( out,
VIPS_META_PAGE_HEIGHT, read->frame_height );
@@ -1239,7 +1239,8 @@ vips_image_remove( VipsImage *image, const char *name )
*/
static const char *vips_image_header_deprecated[] = {
"ipct-data",
"gif-delay"
"gif-delay",
"gif-loop"
};

static void *

0 comments on commit 4616cf1

Please sign in to comment.
You can’t perform that action at this time.