Skip to content

Commit

Permalink
fix(exr): allow an empty "name" metadata to be read (AcademySoftwareF…
Browse files Browse the repository at this point in the history
…oundation#4528)

When the exr "name" metadata (used for the names of subimages/parts)
existed but was the empty string, we were treating it like it didn't
exist (and upon write substituted our own "subimageXY" name, as we are
wont to do for unnamed parts). But now we've seen multi-part exrs where
the name is "" (exists, but empty string) and we want a read-write cycle
to preserve that. Even though it's not a very sensible or helpful part
name, it's technically legal, so we should honor it.

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed Nov 9, 2024
1 parent e09cb27 commit 3b29190
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openexr.imageio/exrinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ OpenEXRInput::PartInfo::parse_header(OpenEXRInput* in,
}

// EXR "name" also gets passed along as "oiio:subimagename".
if (header->hasName() && header->name() != "")
if (header->hasName())
spec.attribute("oiio:subimagename", header->name());

spec.attribute("oiio:subimages", in->m_nsubimages);
Expand Down

0 comments on commit 3b29190

Please sign in to comment.