Use rating from EXIF/XMP where available

This commit is contained in:
Eric Jiang
2019-05-16 17:09:46 -07:00
parent 7512093c20
commit 820024972a
5 changed files with 25 additions and 16 deletions

View File

@@ -188,10 +188,18 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
orientation = tag->valueToString ();
}
// Look for Rating metadata in the following order:
// 1. EXIF
// 2. XMP
// 3. pp3 sidecar file
tag = newFrameRootDir->findTagUpward("Rating");
if (tag) {
if (tag && tag->toInt() != 0) {
rating = tag->toInt();
}
char sXMPRating[64];
if (newFrameRootDir->getXMPTagValue("xmp:Rating", sXMPRating)) {
rating = atoi(sXMPRating);
}
tag = newFrameRootDir->findTagUpward("MakerNote");
rtexif::TagDirectory* mnote = nullptr;