Skip to content

Commit

Permalink
Workaround for version
Browse files Browse the repository at this point in the history
  • Loading branch information
servantftechnicolor committed Jan 28, 2025
1 parent d9d6a44 commit ca5c573
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/aliceVision/image/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,26 @@ oiio::ParamValueList getMetadataFromMap(const std::map<std::string, std::string>
{
oiio::ParamValueList metadata;
for (const auto& metadataPair : metadataMap)
{
if (metadataPair.first == "version")
{
//OpenEXR may crash if version is not stored as an int.
int version = 0;
try
{
version = std::stoi(metadataPair.second);
metadata.push_back(oiio::ParamValue(metadataPair.first, version));
continue;
}
catch (...)
{
//If not an int, then business as usual
}
}

metadata.push_back(oiio::ParamValue(metadataPair.first, metadataPair.second));
}

return metadata;
}

Expand Down

0 comments on commit ca5c573

Please sign in to comment.