{"record":{"id":"06fe15998bf34878","repo":"DrKLO/Telegram","slug":"s-sorry-arithmetic-coding-not-supported","errorCode":null,"errorMessage":"%s: sorry, arithmetic coding not supported\n","messagePattern":"(.+?): sorry, arithmetic coding not supported\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"TMessagesProj/jni/mozjpeg/cjpeg.c","lineNumber":310,"sourceCode":"    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n        outfilename = NULL;     /* -outfile applies to just one input file */\n        continue;               /* ignore this name if previously processed */\n      }\n      break;                    /* else done parsing switches */\n    }\n    arg++;                      /* advance past switch marker character */\n\n    if (keymatch(arg, \"arithmetic\", 1)) {\n      /* Use arithmetic coding. */\n#ifdef C_ARITH_CODING_SUPPORTED\n      cinfo->arith_code = TRUE;\n      \n      /* No table optimization required for AC */\n      cinfo->optimize_coding = FALSE;\n#else\n      fprintf(stderr, \"%s: sorry, arithmetic coding not supported\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"baseline\", 1)) {\n      /* Force baseline-compatible output (8-bit quantizer values). */\n      force_baseline = TRUE;\n      /* Disable multiple scans */\n      simple_progressive = FALSE;\n      cinfo->num_scans = 0;\n      cinfo->scan_info = NULL;\n\n    } else if (keymatch(arg, \"dct\", 2)) {\n      /* Select DCT algorithm. */\n      if (++argn >= argc) {      /* advance to next argument */\n        fprintf(stderr, \"%s: missing argument for dct\\n\", progname);\n        usage();\n      }","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/cjpeg.c#L292-L328","documentation":"cjpeg (mozjpeg's JPEG compressor) was built without arithmetic-coding support (C_ARITH_CODING_SUPPORTED undefined). The -arithmetic switch is therefore unavailable; cjpeg prints this message to stderr and exits with EXIT_FAILURE. Arithmetic coding is an optional libjpeg feature, off by default in many mozjpeg builds.","triggerScenarios":"Invoking `cjpeg -arithmetic ...` against a mozjpeg/libjpeg build compiled without C_ARITH_CODING_SUPPORTED.","commonSituations":"Default mozjpeg package builds often disable arithmetic coding; scripts ported from an IJG libjpeg that had it enabled; CI using a minimal mozjpeg.","solutions":["Drop -arithmetic (the default Huffman coding will be used).","Rebuild mozjpeg with arithmetic coding enabled (-DWITH_ARITH_DEC=ON / -DWITH_ARITH_ENC=ON or define C_ARITH_CODING_SUPPORTED) if arithmetic coding is required."],"exampleFix":"# before\ncjpeg -arithmetic -quality 80 in.ppm > out.jpg\n\n# after - use default Huffman coding\ncjpeg -quality 80 in.ppm > out.jpg","handlingStrategy":"fallback","validationCode":"# Probe whether this cjpeg build supports arithmetic coding before using -arithmetic.\nif cjpeg -h 2>&1 | grep -q arithmetic; then\n  ARITH=-arithmetic\nelse\n  ARITH=   # fall back to default Huffman coding\nfi\ncjpeg $ARITH -quality 80 in.ppm > out.jpg","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat arithmetic coding as an optional feature; do not assume it is compiled in.","If arithmetic coding is mandatory, rebuild mozjpeg with C_ARITH_CODING_SUPPORTED."],"tags":["mozjpeg","cjpeg","cli","compile-flag","jpeg"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}