Skip to content

Commit

Permalink
fix(exr): handle edge case of exr attribute that interferes with our …
Browse files Browse the repository at this point in the history
…hints (#4008)

Our exr writer uses some special hints starting with "openexr:" to
control aspects of the writing, and the reader sets these to
communicate some things about the file it's reading.

But we identified a case where the actual exr file had metadata named
"openexr:levelmode" -- which is of no particular meaning to openexr
itself, but it is the name we use to communicate hints to our writer
by make_texture. We just need to make sure that if we don't set it
proactivesly, we make sure to clear it if there is a stray bit of
metadata with that same name coincidentally.

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz authored Oct 10, 2023
1 parent ab1a0ee commit 2e1e5f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libOpenImageIO/maketexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ write_mipmap(ImageBufAlgo::MakeTextureMode mode, std::shared_ptr<ImageBuf>& img,
if (!mipmap) {
// Send hint to OpenEXR driver that we won't specify a MIPmap
outspec.attribute("openexr:levelmode", 0 /* ONE_LEVEL */);
} else {
outspec.erase_attribute("openexr:levelmode");
}
// OpenEXR always uses border sampling for environment maps
if (envlatlmode) {
Expand Down

0 comments on commit 2e1e5f9

Please sign in to comment.