From 6a582ae1a9aaefda6b95d4b3e537e1588199db8b Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 16 Jun 2011 11:34:20 +0100 Subject: [PATCH] test for res-unit meta before fetching if the res-unit meta is missing, don't generate an error message --- libvips/format/im_vips2tiff.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libvips/format/im_vips2tiff.c b/libvips/format/im_vips2tiff.c index 02dccc5f..c8ec2900 100644 --- a/libvips/format/im_vips2tiff.c +++ b/libvips/format/im_vips2tiff.c @@ -1223,7 +1223,9 @@ make_tiff_write( IMAGE *im, const char *filename ) tw->resunit = RESUNIT_CENTIMETER; tw->xres = im->Xres * 10; tw->yres = im->Yres * 10; - if( !im_meta_get_string( im, IM_META_RESOLUTION_UNIT, &p ) && + + if( vips_image_get_typeof( im, IM_META_RESOLUTION_UNIT ) && + !im_meta_get_string( im, IM_META_RESOLUTION_UNIT, &p ) && strcmp( p, "in" ) == 0 ) { tw->resunit = RESUNIT_INCH; tw->xres *= 2.54;