From 42218cd613efdaf410eff6a816bbb7bf35cc8515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Szabo?= Date: Fri, 21 Jun 2019 15:59:32 +0200 Subject: [PATCH] formatting: use tabs instead of spaces --- libvips/foreign/gifload.c | 22 +++++++++---------- libvips/foreign/magicksave.c | 12 +++++------ libvips/foreign/vips2webp.c | 26 +++++++++++----------- libvips/foreign/webp2vips.c | 42 ++++++++++++++++++------------------ 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/libvips/foreign/gifload.c b/libvips/foreign/gifload.c index 8b12f6a1..ae55da1f 100644 --- a/libvips/foreign/gifload.c +++ b/libvips/foreign/gifload.c @@ -519,10 +519,10 @@ vips_foreign_load_gif_scan_extension( VipsForeignLoadGif *gif ) gif->has_transparency = TRUE; } - if( gif->n_pages % 64 == 0 ) { - gif->delays = (int *) g_realloc( gif->delays, (gif->n_pages + 64) * sizeof(int) ); - } - gif->delays[gif->n_pages] = (extension[2] | (extension[3] << 8)) * 10; + if( gif->n_pages % 64 == 0 ) { + gif->delays = (int *) g_realloc( gif->delays, (gif->n_pages + 64) * sizeof(int) ); + } + gif->delays[gif->n_pages] = (extension[2] | (extension[3] << 8)) * 10; while( extension != NULL ) if( vips_foreign_load_gif_ext_next( gif, @@ -574,12 +574,12 @@ vips_foreign_load_gif_set_header( VipsForeignLoadGif *gif, VipsImage *image ) vips_image_set_int( image, VIPS_META_N_PAGES, gif->n_pages ); vips_image_set_int( image, "gif-loop", gif->loop ); - if ( gif->delays ) { - vips_image_set_int( image, "gif-delay", VIPS_RINT( gif->delays[0] / 10.0 ) ); - vips_image_set_array_int( image, "delay", gif->delays, gif->n_pages ); - } else { - vips_image_set_int( image, "gif-delay", 4 ); - } + if( gif->delays ) { + vips_image_set_int( image, "gif-delay", VIPS_RINT( gif->delays[0] / 10.0 ) ); + vips_image_set_array_int( image, "delay", gif->delays, gif->n_pages ); + } else { + vips_image_set_int( image, "gif-delay", 4 ); + } if( gif->comment ) vips_image_set_string( image, "gif-comment", gif->comment ); @@ -1121,7 +1121,7 @@ vips_foreign_load_gif_init( VipsForeignLoadGif *gif ) { gif->n = 1; gif->transparency = -1; - gif->delays = NULL; + gif->delays = NULL; gif->loop = 0; gif->comment = NULL; gif->dispose = 0; diff --git a/libvips/foreign/magicksave.c b/libvips/foreign/magicksave.c index d23b138d..afe362da 100644 --- a/libvips/foreign/magicksave.c +++ b/libvips/foreign/magicksave.c @@ -109,8 +109,8 @@ vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick ) Image *image; int number; - int *numbers; - int numbers_length; + int *numbers; + int numbers_length; const char *str; g_assert( !magick->current_image ); @@ -143,10 +143,10 @@ vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick ) if( vips_image_get_typeof( im, "delay" ) && !vips_image_get_array_int( im, "delay", &numbers, &numbers_length ) ) { - int page_index = magick->position.top / magick->page_height; - if( page_index < numbers_length ) - image->delay = (size_t) VIPS_RINT( numbers[page_index] / 10.0 ); - } + int page_index = magick->position.top / magick->page_height; + if( page_index < numbers_length ) + image->delay = (size_t) VIPS_RINT( numbers[page_index] / 10.0 ); + } /* ImageMagick uses iterations like this (at least in gif save): * 0 - set 0 loops (infinite) diff --git a/libvips/foreign/vips2webp.c b/libvips/foreign/vips2webp.c index b352abba..f203c803 100644 --- a/libvips/foreign/vips2webp.c +++ b/libvips/foreign/vips2webp.c @@ -308,8 +308,8 @@ get_array_int( VipsImage *image, const char *field, int* n ) static int extract_delay( int index, int *delays, int delays_length, int default_delay ) { - if( delays == NULL || index > delays_length ) return( default_delay ); - return( delays[index] ); + if( delays == NULL || index > delays_length ) return( default_delay ); + return( delays[index] ); } /* Write a set of animated frames into write->memory_writer. @@ -321,8 +321,8 @@ write_webp_anim( VipsWebPWrite *write, VipsImage *image, int page_height ) * standard). */ const int default_delay = 10 * get_int( image, "gif-delay", 10 ); - int delays_length; - const int *delays = get_array_int( image, "delay", &delays_length ); + int delays_length; + const int *delays = get_array_int( image, "delay", &delays_length ); WebPAnimEncoderOptions anim_config; WebPData webp_data; @@ -373,18 +373,18 @@ write_webp_anim( VipsWebPWrite *write, VipsImage *image, int page_height ) WebPPictureFree( &pic ); - int page_index = top / page_height; + int page_index = top / page_height; timestamp_ms += extract_delay( page_index, delays, delays_length, default_delay ); } - /* Closes encoder and add last frame delay. - */ - if( !WebPAnimEncoderAdd( write->enc, - NULL, timestamp_ms, NULL ) ) { - vips_error( "vips2webp", - "%s", _( "anim close error" ) ); - return( -1 ); - } + /* Closes encoder and add last frame delay. + */ + if( !WebPAnimEncoderAdd( write->enc, + NULL, timestamp_ms, NULL ) ) { + vips_error( "vips2webp", + "%s", _( "anim close error" ) ); + return( -1 ); + } if( !WebPAnimEncoderAssemble( write->enc, &webp_data ) ) { vips_error( "vips2webp", diff --git a/libvips/foreign/webp2vips.c b/libvips/foreign/webp2vips.c index 0e79c5fc..d43648f6 100644 --- a/libvips/foreign/webp2vips.c +++ b/libvips/foreign/webp2vips.c @@ -470,32 +470,32 @@ read_header( Read *read, VipsImage *out ) vips_image_set_int( out, VIPS_META_PAGE_HEIGHT, read->frame_height ); - if ( read->frame_count > 1) { - read->delays = (int *) g_malloc( read->frame_count * sizeof(int) ); - - for( int i = 0; i < read->frame_count; i++ ) { - if( WebPDemuxGetFrame( read->demux, i + 1, &iter ) ) { - read->delays[i] = iter.duration; - } else { - read->delays[i] = 0; - } - } + if ( read->frame_count > 1) { + read->delays = (int *) g_malloc( read->frame_count * sizeof(int) ); + + for( int i = 0; i < read->frame_count; i++ ) { + if( WebPDemuxGetFrame( read->demux, i + 1, &iter ) ) { + read->delays[i] = iter.duration; + } else { + read->delays[i] = 0; + } + } #ifdef DEBUG - for( int i = 0; i < read->frame_count; i++ ) { - printf( "webp2vips: frame = %d; duration = %d\n", i + 1, read->delays[i] ); - } + for( int i = 0; i < read->frame_count; i++ ) { + printf( "webp2vips: frame = %d; duration = %d\n", i + 1, read->delays[i] ); + } #endif /*DEBUG*/ - vips_image_set_array_int( out, "delay", read->delays, read->frame_count ); - g_free( read->delays ); + vips_image_set_array_int( out, "delay", read->delays, read->frame_count ); + g_free( read->delays ); + + /* webp uses ms for delays, gif uses centiseconds. + */ + vips_image_set_int( out, "gif-delay", + VIPS_RINT( read->delays[0] / 10.0 ) ); + } - /* webp uses ms for delays, gif uses centiseconds. - */ - vips_image_set_int( out, "gif-delay", - VIPS_RINT( read->delays[0] / 10.0 ) ); - } - WebPDemuxReleaseIterator( &iter ); if( read->n == -1 )