Skip to content

Commit ab694d0

Browse files
authored
maketexture: Ensure proper setting of some metadata (#3634)
Make extra sure to clear the oiio:ConstantColor, oiio:AverageColor, and oio:SHA-1 metadata when writing textures, if those things are not going to be set.
1 parent 0674f8d commit ab694d0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/libOpenImageIO/maketexture.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,15 @@ make_texture_impl(ImageBufAlgo::MakeTextureMode mode, const ImageBuf* input,
17471747
std::string desc = dstspec.get_string_attribute("ImageDescription");
17481748
bool updatedDesc = false;
17491749

1750-
// Eliminate any SHA-1 or ConstantColor hints in the ImageDescription.
1750+
// Clear a bunch of special attributes that we don't want to propagate
1751+
// from an input file to the output file, unless we explicitly set it
1752+
// farther below.
1753+
dstspec.erase_attribute("oiio:ConstantColor=");
1754+
dstspec.erase_attribute("ConstantColor=");
1755+
dstspec.erase_attribute("oiio:AverageColor=");
1756+
dstspec.erase_attribute("AverageColor=");
1757+
dstspec.erase_attribute("oiio:SHA-1=");
1758+
dstspec.erase_attribute("SHA-1=");
17511759
if (desc.size()) {
17521760
Strutil::excise_string_after_head(desc, "oiio:ConstantColor=");
17531761
Strutil::excise_string_after_head(desc, "ConstantColor=");

0 commit comments

Comments
 (0)