{"record":{"id":"7d1a21c09f983d3c","repo":"DrKLO/Telegram","slug":"s-sorry-entropy-optimization-was-not-compiled","errorCode":null,"errorMessage":"%s: sorry, entropy optimization was not compiled\n","messagePattern":"(.+?): sorry, entropy optimization was not compiled\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"TMessagesProj/jni/mozjpeg/jpegtran.c","lineNumber":290,"sourceCode":"    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      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, \"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\\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        usage();\n      outfilename = argv[argn]; /* save it away for later use */\n\n    } else if (keymatch(arg, \"perfect\", 2)) {\n      /* Fail if there is any partial edge MCUs that the transform can't\n       * handle. */\n      transformoption.perfect = TRUE;\n\n    } else if (keymatch(arg, \"progressive\", 2)) {\n      /* Select simple progressive mode. */\n#ifdef C_PROGRESSIVE_SUPPORTED","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/jpegtran.c#L272-L308","documentation":"The -optimize (or -optimise) flag was passed but the build lacks ENTROPY_OPT_SUPPORTED, the compile-time feature enabling Huffman table optimization. jpegtran exits with failure at parse time; no processing occurs.","triggerScenarios":"Invoking jpegtran -optimize on a libjpeg/mozjpeg build compiled without entropy optimization support. The flag is recognized but its handler is in the #else branch.","commonSituations":"Ultra-minimal decode-oriented builds, older embedded libjpeg variants, or a misconfigured CMake build that set -DWITH_ENTROPY_OPT=0 (if exposed). Command copied from documentation that assumes the feature is present.","solutions":["Drop the -optimize flag and rely on default coding.","Rebuild with ENTROPY_OPT_SUPPORTED defined (standard in libjpeg-turbo/mozjpeg; verify the CMake option).","Probe for the feature at build time and disable the flag conditionally.","Use mozjpeg, which enables optimization by default, instead of stripped libjpeg."],"exampleFix":"# before\n./jpegtran -optimize in.jpg > out.jpg\n# after: drop the flag or rebuild\n./jpegtran in.jpg > out.jpg   # or rebuild mozjpeg with ENTROPY_OPT_SUPPORTED","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"#ifndef ENTROPY_OPT_SUPPORTED\n#error \"entropy optimization unavailable; do not pass -optimize\"\n#endif","tryCatchPattern":null,"preventionTips":["Guard -optimize behind a feature probe.","Prefer mozjpeg, which optimizes by default.","Drop the flag on stripped builds."],"tags":["jpegtran","entropy-optimization","build-config","compile-time","mozjpeg"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}