Merge pull request #1145 from jcupitt/master

fix vips_image_dump()
This commit is contained in:
John Cupitt 2018-10-29 13:31:42 +00:00 committed by GitHub
commit ecdbf66f4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 23 deletions

View File

@ -16,6 +16,8 @@
* - more severing for vips_image_write()
* 3/4/18
* - better rules for hasalpha
* 9/10/18
* - fix up vips_image_dump(), it was still using ints not enums
*/
/*
@ -579,29 +581,8 @@ print_field_fn( VipsImage *image, const char *field, GValue *value, void *a )
{
VipsBuf *buf = (VipsBuf *) a;
const char *extra;
char *str_value;
/* Look for known enums and decode them.
*/
extra = NULL;
if( strcmp( field, "coding" ) == 0 )
extra = vips_enum_nick(
VIPS_TYPE_CODING, g_value_get_int( value ) );
else if( strcmp( field, "format" ) == 0 )
extra = vips_enum_nick(
VIPS_TYPE_BAND_FORMAT, g_value_get_int( value ) );
else if( strcmp( field, "interpretation" ) == 0 )
extra = vips_enum_nick(
VIPS_TYPE_INTERPRETATION, g_value_get_int( value ) );
str_value = g_strdup_value_contents( value );
vips_buf_appendf( buf, "%s: %s", field, str_value );
g_free( str_value );
if( extra )
vips_buf_appendf( buf, " - %s", extra );
vips_buf_appendf( buf, "%s: ", field );
vips_buf_appendgv( buf, value );
vips_buf_appendf( buf, "\n" );
return( NULL );