Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/aliceVision/image/dcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2406,7 +2406,9 @@ void DCPDatabase::clear()

bool DCPDatabase::retrieveDcpForCamera(const std::string& make, const std::string& model, DCPProfile& dcpProf)
{
const std::string dcpKey = make + "_" + model;
const std::string makeLower = boost::algorithm::to_lower_copy(make);
const std::string modelLower = boost::algorithm::to_lower_copy(model);
const std::string dcpKey = makeLower + "_" + modelLower;

{
// Retrieve preloaded DCPProfile
Expand All @@ -2421,8 +2423,8 @@ bool DCPDatabase::retrieveDcpForCamera(const std::string& make, const std::strin
{
// Load DCPProfile from disk
const std::vector<std::string>::iterator it =
std::find_if(dcpFilenamesList.begin(), dcpFilenamesList.end(), [make, model](const std::string& s) {
return (s.find(make) != std::string::npos) && (s.find(model) != std::string::npos);
std::find_if(dcpFilenamesList.begin(), dcpFilenamesList.end(), [makeLower, modelLower](const std::string& s) {
return boost::algorithm::icontains(s, makeLower) && boost::algorithm::icontains(s, modelLower);
});

if (it != dcpFilenamesList.end())
Expand All @@ -2438,7 +2440,9 @@ bool DCPDatabase::retrieveDcpForCamera(const std::string& make, const std::strin

void DCPDatabase::add_or_replace(DCPProfile& dcpProf, const std::string& make, const std::string& model)
{
const std::string dcpKey = make + "_" + model;
const std::string makeLower = boost::algorithm::to_lower_copy(make);
const std::string modelLower = boost::algorithm::to_lower_copy(model);
const std::string dcpKey = makeLower + "_" + modelLower;

std::map<std::string, image::DCPProfile>::iterator it = dcpStore.find(dcpKey);
if (it != dcpStore.end())
Expand Down
Loading