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;