From cdd6eb2765c8df1432c7ddfeab0986d358b15770 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Fri, 1 Oct 2010 11:07:44 +0000 Subject: [PATCH] #726: Tweak to make it select the correct primary image. --- src/tiffimage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp index ec780623..e9341b65 100644 --- a/src/tiffimage.cpp +++ b/src/tiffimage.cpp @@ -109,8 +109,10 @@ namespace Exiv2 { ExifData::const_iterator md = exifData_.findKey(ExifKey(keys[i])); // Is it the primary image? if (md != exifData_.end() && md->count() > 0 && md->toLong() == 0) { + // Sometimes there is a JPEG primary image; that's not our first choice groupName = md->groupName(); - break; + std::string key = "Exif." + groupName + ".JPEGInterchangeFormat"; + if (exifData_.findKey(ExifKey(key)) == exifData_.end()) break; } } return groupName;