From d68366982b85afcb7a03436b8330678ca2e67246 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Tue, 2 Jul 2019 20:54:25 +0200 Subject: [PATCH] Fixed issue with reading the EXIFTAG_SUBJECTLOCATION. --- coders/tiff.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/coders/tiff.c b/coders/tiff.c index 90283ab43..dae8375ef 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -189,7 +189,7 @@ static const ExifInfo { EXIFTAG_FOCALPLANEXRESOLUTION, TIFF_RATIONAL, 0, "exif:FocalPlaneXResolution" }, { EXIFTAG_FOCALPLANEYRESOLUTION, TIFF_RATIONAL, 0, "exif:FocalPlaneYResolution" }, { EXIFTAG_FOCALPLANERESOLUTIONUNIT, TIFF_SHORT, 0, "exif:FocalPlaneResolutionUnit" }, - { EXIFTAG_SUBJECTLOCATION, TIFF_SHORT, 0, "exif:SubjectLocation" }, + { EXIFTAG_SUBJECTLOCATION, TIFF_SHORT, 2, "exif:SubjectLocation" }, { EXIFTAG_EXPOSUREINDEX, TIFF_RATIONAL, 0, "exif:ExposureIndex" }, { EXIFTAG_SENSINGMETHOD, TIFF_SHORT, 0, "exif:SensingMethod" }, { EXIFTAG_FILESOURCE, TIFF_NOTYPE, 0, "exif:FileSource" }, @@ -859,6 +859,16 @@ static void TIFFGetEXIFProperties(TIFF *tiff,Image *image, if (TIFFGetField(tiff,exif_info[i].tag,&shorty,sans) == 1) (void) FormatLocaleString(value,MagickPathExtent,"%d",shorty); } + else if (exif_info[i].variable_length == 2) + { + uint16 + *shorty; + + shorty=0; + if ((TIFFGetField(tiff,exif_info[i].tag,&shorty,sans) == 1) && + (shorty != (uint16 *) NULL)) + (void) FormatLocaleString(value,MagickPathExtent,"%d",*shorty); + } else { int -- 2.40.0