From 1c45a700f64a76edc16bb2134040b19ffaf2b9af Mon Sep 17 00:00:00 2001 From: cristy Date: Fri, 5 Dec 2014 11:13:48 +0000 Subject: [PATCH] --- coders/tiff.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/coders/tiff.c b/coders/tiff.c index 704a4fc5c..dd87750a5 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -734,20 +734,7 @@ static void TIFFGetEXIFProperties(TIFF *tiff,Image *image, } case TIFF_SHORT: { - if (exif_info[i].variable_length != 0) - { - int - tiff_status; - - uint16 - *shorty; - - tiff_status=TIFFGetField(tiff,exif_info[i].tag,&sans,&shorty,&sans, - &sans); - if (tiff_status == 1) - (void) FormatLocaleString(value,MaxTextExtent,"%d",shorty[0]); - } - else + if (exif_info[i].variable_length == 0) { uint16 shorty; @@ -756,6 +743,23 @@ static void TIFFGetEXIFProperties(TIFF *tiff,Image *image, if (TIFFGetField(tiff,exif_info[i].tag,&shorty,&sans,&sans) == 1) (void) FormatLocaleString(value,MaxTextExtent,"%d",shorty); } + else + { + int + tiff_status; + + uint16 + *shorty; + + uint16 + shorty_num; + + tiff_status=TIFFGetField(tiff,exif_info[i].tag,&shorty_num,&shorty, + &sans,&sans); + if (tiff_status == 1) + (void) FormatLocaleString(value,MaxTextExtent,"%d", + shorty_num != 0 ? shorty[0] : 0); + } break; } case TIFF_LONG: -- 2.40.0