Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions 26 src/libOpenImageIO/xmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,14 @@ add_attrib(ImageSpec& spec, string_view xmlname, string_view xmlvalue,

// See if it's in the xmp table, which will tell us something about the
// proper type (everything in the xml itself just looks like a string).
if (const XMPtag* xt = xmp_tagmap_ref().find(xmlname)) {
if (!xt->oiioname || !xt->oiioname[0])
const XMPtag* xmptagptr = xmp_tagmap_ref().find(xmlname);
if (xmptagptr) {
if (!xmptagptr->oiioname || !xmptagptr->oiioname[0])
return 0; // ignore it purposefully
// Found
oiioname = xt->oiioname;
oiiotype = xt->oiiotype;
special = xt->special;
oiioname = xmptagptr->oiioname;
oiiotype = xmptagptr->oiiotype;
special = xmptagptr->special;
}

// Also try looking it up to see if it's a known exif tag.
Expand All @@ -330,6 +331,21 @@ add_attrib(ImageSpec& spec, string_view xmlname, string_view xmlvalue,
return 0; // skip
}

if (Strutil::istarts_with(xmlname, "tiff:")) {
if (!xmptagptr) // Ignore any "tiff:" entry not in the table
return 0;
if (special & TiffRedundant) // Ignore ones marked redundant
return 0;
// Ignore any TIFF related ones we already have set in the spec, don't
// let the XMP version overwrite what we gleaned directly from the
// file.
if (spec.find_attribute(oiioname))
return 0;
}

if (special & Suppress)
return 0; // Marked as one to suppress

// Guess the type if unknown
if (oiiotype == TypeUnknown) {
if (Strutil::string_is_int(xmlvalue))
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.