Skip to content

Commit

Permalink
correctly report distance when quality is used
Browse files Browse the repository at this point in the history
fixes #29
  • Loading branch information
mo271 committed Oct 15, 2024
1 parent ea6134e commit 13dfbac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/cjpegli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "lib/extras/dec/decode.h"
#include "lib/extras/enc/jpegli.h"
#include "lib/extras/time.h"
#include "lib/jpegli/encode.h"
#include "tools/args.h"
#include "tools/cmdline.h"
#include "tools/file_io.h"
Expand Down Expand Up @@ -216,9 +217,13 @@ int CJpegliMain(int argc, const char* argv[]) {

if (!args.quiet) {
const jxl::extras::JpegSettings& s = args.settings;
float calculated_distance =
cmdline.GetOption(args.opt_quality_id)->matched()
? jpegli_quality_to_distance(s.quality)
: s.distance;
fprintf(stderr, "Encoding [%s%s d%.3f%s %sAQ p%d %s]\n",
s.xyb ? "XYB" : "YUV", s.chroma_subsampling.c_str(), s.distance,
s.use_std_quant_tables ? " StdQuant" : "",
s.xyb ? "XYB" : "YUV", s.chroma_subsampling.c_str(),
calculated_distance, s.use_std_quant_tables ? " StdQuant" : "",
s.use_adaptive_quantization ? "" : "no", s.progressive_level,
s.optimize_coding ? "OPT" : "FIX");
}
Expand Down

0 comments on commit 13dfbac

Please sign in to comment.