Skip to content

Commit e9939ac

Browse files
committed
better enum display
"header" just displays enum nick
1 parent 7bc6212 commit e9939ac

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
started 8.6.1 1/5/18
2+
- better enum display in header
3+
14
started 8.6.0 16/8/17
25
- add scRGB support
36
- improve radiance support

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Process this file with autoconf to produce a configure script.
22

3-
AC_INIT([nip2], [8.6.0], [vipsip@jiscmail.ac.uk])
3+
AC_INIT([nip2], [8.6.1], [vipsip@jiscmail.ac.uk])
44

55
# foreign stops complaints about a missing README (we use README.md instead)
66
# and missing INSTALL (the standard Gnu INSTALL is not very useful)
@@ -17,7 +17,7 @@ dnl
1717

1818
m4_define([nip_major_version], [8])
1919
m4_define([nip_minor_version], [6])
20-
m4_define([nip_micro_version], [0])
20+
m4_define([nip_micro_version], [1])
2121
m4_define([nip_version],
2222
[nip_major_version.nip_minor_version.nip_micro_version])
2323

po/en_GB.gmo

-41 Bytes
Binary file not shown.

src/imageheader.c

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,27 @@ imageheader_add_item( IMAGE *im,
6868
char txt[256];
6969
VipsBuf buf = VIPS_BUF_STATIC( txt );
7070
GtkTreeIter iter;
71-
char *value_str;
72-
const char *extra;
7371

74-
value_str = g_strdup_value_contents( value );
75-
vips_buf_appendf( &buf, "%s", value_str );
76-
77-
/* Look for enums and decode them.
72+
/* Show the nicks for enums.
7873
*/
79-
extra = NULL;
80-
if( strcmp( field, "coding" ) == 0 )
81-
extra = vips_enum_nick( VIPS_TYPE_CODING,
82-
g_value_get_int( value ) );
83-
else if( strcmp( field, "format" ) == 0 )
84-
extra = vips_enum_nick( VIPS_TYPE_BAND_FORMAT,
85-
g_value_get_int( value ) );
86-
else if( strcmp( field, "interpretation" ) == 0 )
87-
extra = vips_enum_nick( VIPS_TYPE_INTERPRETATION,
88-
g_value_get_int( value ) );
89-
if( extra )
90-
vips_buf_appendf( &buf, " - %s", extra );
74+
if( G_VALUE_HOLDS_ENUM( value ) )
75+
vips_buf_appendf( &buf, "%s",
76+
vips_enum_nick( G_VALUE_TYPE( value ),
77+
g_value_get_enum( value ) ) );
78+
else {
79+
char *value_str;
80+
81+
value_str = g_strdup_value_contents( value );
82+
vips_buf_appendf( &buf, "%s", value_str );
83+
g_free( value_str );
84+
}
9185

9286
gtk_list_store_append( imageheader->store, &iter );
9387
gtk_list_store_set( imageheader->store, &iter,
9488
NAME_COLUMN, field,
9589
VALUE_COLUMN, vips_buf_all( &buf ),
9690
-1 );
9791

98-
g_free( value_str );
99-
10092
return( NULL );
10193
}
10294

0 commit comments

Comments
 (0)