Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix on dng reading #1502

Merged
merged 2 commits into from
Aug 3, 2023
Merged
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
14 changes: 7 additions & 7 deletions src/software/utils/main_imageProcessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ struct ProcessingParams
bool fixNonFinite = false;
bool applyDcpMetadata = false;
bool useDCPColorMatrixOnly = false;
bool sourceIsRaw = false;
bool enableColorTempProcessing = false;
double correlatedColorTemperature = -1.0;

LensCorrectionParams lensCorrection =
Expand Down Expand Up @@ -600,7 +600,7 @@ void processImage(image::Image<image::RGBAfColor>& image, const ProcessingParams
#endif
}

if (pParams.applyDcpMetadata || (pParams.sourceIsRaw && pParams.correlatedColorTemperature <= 0.0))
if (pParams.applyDcpMetadata || (pParams.enableColorTempProcessing && pParams.correlatedColorTemperature <= 0.0))
{
bool dcpMetadataOK = map_has_non_empty_value(imageMetadata, "AliceVision:DCP:Temp1") &&
map_has_non_empty_value(imageMetadata, "AliceVision:DCP:Temp2") &&
Expand Down Expand Up @@ -678,7 +678,7 @@ void processImage(image::Image<image::RGBAfColor>& image, const ProcessingParams
double cct = pParams.correlatedColorTemperature;
double tint;

if (pParams.sourceIsRaw)
if (pParams.enableColorTempProcessing)
{
dcpProf.getColorTemperatureAndTintFromNeutral(neutral, cct, tint);
}
Expand All @@ -690,7 +690,7 @@ void processImage(image::Image<image::RGBAfColor>& image, const ProcessingParams

imageMetadata["AliceVision:ColorTemperature"] = std::to_string(cct);
}
else if (pParams.sourceIsRaw && pParams.correlatedColorTemperature > 0.0)
else if (pParams.enableColorTempProcessing && pParams.correlatedColorTemperature > 0.0)
{
imageMetadata["AliceVision:ColorTemperature"] = std::to_string(pParams.correlatedColorTemperature);
}
Expand Down Expand Up @@ -1108,7 +1108,7 @@ int aliceVision_main(int argc, char * argv[])
options.rawAutoBright = pParams.rawAutoBright;
options.correlatedColorTemperature = correlatedColorTemperature;
pParams.correlatedColorTemperature = correlatedColorTemperature;
pParams.sourceIsRaw = true;
pParams.enableColorTempProcessing = options.rawColorInterpretation == image::ERawColorInterpretation::DcpLinearProcessing;
}

if (pParams.lensCorrection.enabled && pParams.lensCorrection.vignetting)
Expand Down Expand Up @@ -1331,7 +1331,7 @@ int aliceVision_main(int argc, char * argv[])
(rawColorInterpretation == image::ERawColorInterpretation::DcpMetadata)))
{
// Fallback case of missing profile but no error requested
readOptions.rawColorInterpretation = image::ERawColorInterpretation::LibRawNoWhiteBalancing;
readOptions.rawColorInterpretation = image::ERawColorInterpretation::LibRawWhiteBalancing;
}
else
{
Expand All @@ -1351,7 +1351,7 @@ int aliceVision_main(int argc, char * argv[])
readOptions.rawAutoBright = pParams.rawAutoBright;
readOptions.correlatedColorTemperature = correlatedColorTemperature;
pParams.correlatedColorTemperature = correlatedColorTemperature;
pParams.sourceIsRaw = true;
pParams.enableColorTempProcessing = readOptions.rawColorInterpretation == image::ERawColorInterpretation::DcpLinearProcessing;

pParams.useDCPColorMatrixOnly = useDCPColorMatrixOnly;
if (pParams.applyDcpMetadata)
Expand Down