diff --git a/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx b/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx index 54e38669174e69349a7be93759944f2e79410b4d..de88f29bf436077f2e5e34eea2b90ebf8bbe18a4 100644 --- a/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx +++ b/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx @@ -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; diff --git a/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx index 2d6ba2c4775e596123d18c3019a853fe2b7c10a7..94f55e0a467af0e593d9d54ab0abd222a5bd283e 100644 --- a/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx +++ b/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx @@ -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; }