Skip to content

Commit

Permalink
Resolve PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mátyás Császár committed Jul 7, 2023
1 parent 722b226 commit f924180
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions tools/ktx/command_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2129,15 +2129,16 @@ void CommandCreate::checkSpecsMatch(const ImageInput& currentFile, const ImageSp
if (currentFormat.transfer() != firstFormat.transfer()) {
if (options.assignOETF.has_value()) {
warning("Input image \"{}\" has different transfer function ({}) than the first image ({})"
" but will be threaded identically as specified by the --assign-oetf option.",
" but will be treated identically as specified by the --assign-oetf option.",
currentFile.filename(), toString(currentFormat.transfer()), toString(firstFormat.transfer()));
} else if (options.convertOETF.has_value()) {
warning("Input image \"{}\" has different transfer function ({}) than the first image ({})"
" and thus will go through different transfer function conversion to the target transfer"
" function specified by the --convert-oetf option.",
currentFile.filename(), toString(currentFormat.transfer()), toString(firstFormat.transfer()));
} else {
fatal(rc::INVALID_FILE, "Input image \"{}\" has different transfer function ({}) than the first image ({}).",
fatal(rc::INVALID_FILE, "Input image \"{}\" has different transfer function ({}) than the first image ({})."
" Use --assign-oetf or --convert-oetf to specify handling and stop this error.",
currentFile.filename(), toString(currentFormat.transfer()), toString(firstFormat.transfer()));
}
}
Expand All @@ -2147,31 +2148,33 @@ void CommandCreate::checkSpecsMatch(const ImageInput& currentFile, const ImageSp
auto firstGamma = firstFormat.oeGamma() != -1 ? std::to_string(firstFormat.oeGamma()) : "no gamma";
if (options.assignOETF.has_value()) {
warning("Input image \"{}\" has different gamma ({}) than the first image ({})"
" but will be threaded identically as specified by the --assign-oetf option.",
" but will be treated identically as specified by the --assign-oetf option.",
currentFile.filename(), currentGamma, firstGamma);
} else if (options.convertOETF.has_value()) {
warning("Input image \"{}\" has different gamma ({}) than the first image ({})"
" and thus will go through different transfer function conversion to the target transfer"
" function specified by the --convert-oetf option.",
currentFile.filename(), currentGamma, firstGamma);
} else {
fatal(rc::INVALID_FILE, "Input image \"{}\" has different gamma ({}) than the first image ({}).",
fatal(rc::INVALID_FILE, "Input image \"{}\" has different gamma ({}) than the first image ({})."
" Use --assign-oetf or --convert-oetf to specify handling and stop this error.",
currentFile.filename(), currentGamma, firstGamma);
}
}

if (currentFormat.primaries() != firstFormat.primaries()) {
if (options.assignPrimaries.has_value()) {
warning("Input image \"{}\" has different primaries ({}) than the first image ({})"
" but will be threaded identically as specified by the --assign-primaries option.",
" but will be treated identically as specified by the --assign-primaries option.",
currentFile.filename(), toString(currentFormat.primaries()), toString(firstFormat.primaries()));
} else if (options.convertPrimaries.has_value()) {
warning("Input image \"{}\" has different primaries ({}) than the first image ({})"
" and thus will go through different primaries conversion to the target primaries"
" specified by the --convert-primaries option.",
currentFile.filename(), toString(currentFormat.primaries()), toString(firstFormat.primaries()));
} else {
fatal(rc::INVALID_FILE, "Input image \"{}\" has different primaries ({}) than the first image ({}).",
fatal(rc::INVALID_FILE, "Input image \"{}\" has different primaries ({}) than the first image ({})."
" Use --assign-primaries or --convert-primaries to specify handling and stop this error.",
currentFile.filename(), toString(currentFormat.primaries()), toString(firstFormat.primaries()));
}
}
Expand Down

0 comments on commit f924180

Please sign in to comment.