Skip to content

Commit

Permalink
This fixes the one component case.
Browse files Browse the repository at this point in the history
  • Loading branch information
aous72 committed Sep 20, 2024
1 parent 2a36ea4 commit 27c9a2e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/apps/ojph_compress/ojph_compress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,10 +788,20 @@ int main(int argc, char * argv[]) {
if (num_precincts != -1)
cod.set_precinct_size(num_precincts, precinct_size);
cod.set_progression_order(prog_order);
if (employ_color_transform == -1)
cod.set_color_transform(true);
if (num_comps == 1)
{
if (employ_color_transform != -1)
OJPH_WARN(0x01000016,
"-colour_trans option is not needed and was not used; "
"this is because the image has one component only\n");
}
else
cod.set_color_transform(employ_color_transform == 1);
{
if (employ_color_transform == -1)
cod.set_color_transform(true);
else
cod.set_color_transform(employ_color_transform == 1);
}
cod.set_reversible(reversible);
if (!reversible && quantization_step != -1.0f)
codestream.access_qcd().set_irrev_quant(quantization_step);
Expand Down

0 comments on commit 27c9a2e

Please sign in to comment.