Skip to content

Commit bf8d8b9

Browse files
Fabien Servantservantftransperfect
authored andcommitted
Workaround for version
1 parent 0d6560a commit bf8d8b9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/aliceVision/image/io.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,26 @@ oiio::ParamValueList getMetadataFromMap(const std::map<std::string, std::string>
483483
{
484484
oiio::ParamValueList metadata;
485485
for (const auto& metadataPair : metadataMap)
486+
{
487+
if (metadataPair.first == "version")
488+
{
489+
//OpenEXR may crash if version is not stored as an int.
490+
int version = 0;
491+
try
492+
{
493+
version = std::stoi(metadataPair.second);
494+
metadata.push_back(oiio::ParamValue(metadataPair.first, version));
495+
continue;
496+
}
497+
catch (...)
498+
{
499+
//If not an int, then business as usual
500+
}
501+
}
502+
486503
metadata.push_back(oiio::ParamValue(metadataPair.first, metadataPair.second));
504+
}
505+
487506
return metadata;
488507
}
489508

0 commit comments

Comments
 (0)