Skip to content

Commit

Permalink
fix(exr): beware exr attributes that interfere with our hints
Browse files Browse the repository at this point in the history
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 committed Oct 9, 2023
1 parent d348067 commit 6cf3fee
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 6cf3fee

Please sign in to comment.