Commit d96e3ade authored by Antoine Regimbeau's avatar Antoine Regimbeau

BUG: look for actual value of RGB band in ossim keyword list

parent dfdf6f9c
......@@ -441,10 +441,10 @@ private:
catch ( itk::ExceptionObject & /*err*/ )
{
}
SetParameterInt("rgb.r",metadataInterface->GetDefaultDisplay()[0]);
SetParameterInt("rgb.g",metadataInterface->GetDefaultDisplay()[1]);
SetParameterInt("rgb.b",metadataInterface->GetDefaultDisplay()[2]);
auto rgbVect = metadataInterface->GetDefaultDisplay();
SetParameterInt("rgb.r",rgbVect[0]);
SetParameterInt("rgb.g",rgbVect[1]);
SetParameterInt("rgb.b",rgbVect[2]);
ossOutput << std::endl << "Image default RGB composition:" << std::endl;
ossOutput << "\t[R, G, B] = [" << GetParameterInt("rgb.r") << "," << GetParameterInt("rgb.g") << "," << GetParameterInt("rgb.b") << "]" << std::endl;
......
......@@ -944,13 +944,24 @@ PleiadesImageMetadataInterface
itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
}
std::vector<unsigned int> rgb(3);
rgb[0] = 0;
rgb[1] = 1;
rgb[2] = 2;
if ( imageKeywordlist.HasKey( "support_data.band_name_list" ) )
{
const std::string & rgbOrder =
imageKeywordlist.GetMetadataByKey( "support_data.band_name_list" );
auto place = rgbOrder.find("B");
for (int i = 0 ; i < 3 ; i++ )
{
rgb[i] = rgbOrder[place+1] -'0';
place = rgbOrder.find("B", place+1 );
}
}
return rgb;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment