{"record":{"id":"434ec3f61dc2899b","repo":"DrKLO/Telegram","slug":"s-sorry-entropy-optimization-was-not-compiled-i","errorCode":null,"errorMessage":"%s: sorry, entropy optimization was not compiled in\n","messagePattern":"(.+?): sorry, entropy optimization was not compiled in\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"TMessagesProj/jni/mozjpeg/cjpeg.c","lineNumber":414,"sourceCode":"      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n        usage();\n      if (ch == 'm' || ch == 'M')\n        lval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"dc-scan-opt\", 3)) {\n      if (++argn >= argc) {      /* advance to next argument */\n        fprintf(stderr, \"%s: missing argument for dc-scan-opt\\n\", progname);\n        usage();\n      }\n      jpeg_c_set_int_param(cinfo, JINT_DC_SCAN_OPT_MODE, atoi(argv[argn]));\n\n    } else if (keymatch(arg, \"optimize\", 1) || keymatch(arg, \"optimise\", 1)) {\n      /* Enable entropy parm optimization. */\n#ifdef ENTROPY_OPT_SUPPORTED\n      cinfo->optimize_coding = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, entropy optimization was not compiled in\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc) {      /* advance to next argument */\n        fprintf(stderr, \"%s: missing argument for outfile\\n\", progname);\n        usage();\n      }\n      outfilename = argv[argn]; /* save it away for later use */\n\n    } else if (keymatch(arg, \"progressive\", 1)) {\n      /* Select simple progressive mode. */\n#ifdef C_PROGRESSIVE_SUPPORTED\n      simple_progressive = TRUE;\n      /* We must postpone execution until num_components is known. */\n#else","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/cjpeg.c#L396-L432","documentation":"cjpeg was built without entropy-optimization support (ENTROPY_OPT_SUPPORTED undefined). The -optimize/-optimise switch (which enables optimal Huffman table generation) is therefore unavailable; cjpeg prints this message and exits with EXIT_FAILURE. Most standard libjpeg/mozjpeg builds DO define ENTROPY_OPT_SUPPORTED, so hitting this means a deliberately stripped build.","triggerScenarios":"Invoking `cjpeg -optimize ...` against a mozjpeg/libjpeg build compiled without ENTROPY_OPT_SUPPORTED.","commonSituations":"A minimal/embedded libjpeg build that disabled entropy optimization to reduce code size; a stripped vendor build.","solutions":["Drop -optimize (default tables will be used).","Rebuild libjpeg/mozjpeg with ENTROPY_OPT_SUPPORTED defined if optimized coding is required."],"exampleFix":"# before\ncjpeg -optimize -quality 80 in.ppm > out.jpg\n\n# after\ncjpeg -quality 80 in.ppm > out.jpg","handlingStrategy":"fallback","validationCode":"# Probe entropy-optimization support before relying on -optimize.\nif cjpeg -h 2>&1 | grep -q optimize; then\n  OPT=-optimize\nelse\n  OPT=   # fall back to default tables\nfi\ncjpeg $OPT -quality 80 in.ppm > out.jpg","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not assume -optimize is always compiled in.","Rebuild with ENTROPY_OPT_SUPPORTED if optimized Huffman tables are required."],"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"}