check for unknown exif tags
exif_tag_get_name() can return NULL for unknown tags, check
This commit is contained in:
parent
6fa6ad40aa
commit
c2e8406ca0
@ -487,20 +487,23 @@ typedef struct _VipsExif {
|
|||||||
static void
|
static void
|
||||||
attach_exif_entry( ExifEntry *entry, VipsExif *ve )
|
attach_exif_entry( ExifEntry *entry, VipsExif *ve )
|
||||||
{
|
{
|
||||||
char name_txt[256];
|
const char *tag_name;
|
||||||
VipsBuf name = VIPS_BUF_STATIC( name_txt );
|
char vips_name_txt[256];
|
||||||
|
VipsBuf vips_name = VIPS_BUF_STATIC( vips_name_txt );
|
||||||
char value_txt[256];
|
char value_txt[256];
|
||||||
VipsBuf value = VIPS_BUF_STATIC( value_txt );
|
VipsBuf value = VIPS_BUF_STATIC( value_txt );
|
||||||
|
|
||||||
vips_buf_appendf( &name, "exif-ifd%d-%s",
|
if( !(tag_name = exif_tag_get_name( entry->tag )) )
|
||||||
exif_entry_get_ifd( entry ),
|
return;
|
||||||
exif_tag_get_name( entry->tag ) );
|
|
||||||
|
vips_buf_appendf( &vips_name, "exif-ifd%d-%s",
|
||||||
|
exif_entry_get_ifd( entry ), tag_name );
|
||||||
vips_exif_to_s( ve->ed, entry, &value );
|
vips_exif_to_s( ve->ed, entry, &value );
|
||||||
|
|
||||||
/* Can't do anything sensible with the error return.
|
/* Can't do anything sensible with the error return.
|
||||||
*/
|
*/
|
||||||
(void) vips_image_set_string( ve->image,
|
(void) vips_image_set_string( ve->image,
|
||||||
vips_buf_all( &name ), vips_buf_all( &value ) );
|
vips_buf_all( &vips_name ), vips_buf_all( &value ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user