From 986b5dff173413fa712db27eb677cdef15f0bab6 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 13 Oct 2019 11:18:55 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1748 --- coders/tiff.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/coders/tiff.c b/coders/tiff.c index 366abc853..dd0766df9 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -703,9 +703,20 @@ static void TIFFGetProfiles(TIFF *tiff,Image *image,ExceptionInfo *exception) if ((TIFFGetField(tiff,TIFFTAG_XMLPACKET,&length,&profile) == 1) && (profile != (unsigned char *) NULL)) { + StringInfo + *dng; + (void) ReadProfile(image,"xmp",profile,(ssize_t) length,exception); - if (strstr((char *) profile,"dc:format=\"image/dng\"") != (char *) NULL) - (void) CopyMagickString(image->magick,"DNG",MagickPathExtent); + dng=BlobToStringInfo(profile,length); + if (dng != (StringInfo *) NULL) + { + const char + *target = "dc:format=\"image/dng\""; + + if (strstr((char *) GetStringInfoDatum(dng),target) != (char *) NULL) + (void) CopyMagickString(image->magick,"DNG",MagickPathExtent); + dng=DestroyStringInfo(dng); + } } #endif if ((TIFFGetField(tiff,34118,&length,&profile) == 1) && @@ -869,7 +880,7 @@ static void TIFFGetEXIFProperties(TIFF *tiff,Image *image, { uint16 *shorty; - + shorty=0; if ((TIFFGetField(tiff,exif_info[i].tag,&shorty,sans) == 1) && (shorty != (uint16 *) NULL)) -- 2.40.0