Skip to content

Commit 2e1e5f9

Browse files
authored
fix(exr): handle edge case of exr attribute that interferes with our 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 <lg@larrygritz.com>
1 parent ab1a0ee commit 2e1e5f9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/libOpenImageIO/maketexture.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,8 @@ write_mipmap(ImageBufAlgo::MakeTextureMode mode, std::shared_ptr<ImageBuf>& img,
647647
if (!mipmap) {
648648
// Send hint to OpenEXR driver that we won't specify a MIPmap
649649
outspec.attribute("openexr:levelmode", 0 /* ONE_LEVEL */);
650+
} else {
651+
outspec.erase_attribute("openexr:levelmode");
650652
}
651653
// OpenEXR always uses border sampling for environment maps
652654
if (envlatlmode) {

0 commit comments

Comments
 (0)