{"record":{"id":"7a5931cf49d3b695","repo":"DrKLO/Telegram","slug":"s-missing-argument-for-dct","errorCode":null,"errorMessage":"%s: missing argument for dct\n","messagePattern":"(.+?): missing argument for dct\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"TMessagesProj/jni/mozjpeg/cjpeg.c","lineNumber":326,"sourceCode":"      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      }\n      if (keymatch(argv[argn], \"int\", 1)) {\n        cinfo->dct_method = JDCT_ISLOW;\n      } else if (keymatch(argv[argn], \"fast\", 2)) {\n        cinfo->dct_method = JDCT_IFAST;\n      } else if (keymatch(argv[argn], \"float\", 2)) {\n        cinfo->dct_method = JDCT_FLOAT;\n      } else {\n        fprintf(stderr, \"%s: invalid argument for dct\\n\", progname);\n        usage();\n      }\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/cjpeg.c#L308-L344","documentation":"The -dct switch requires a following argument selecting the DCT algorithm (int, fast, or float). cjpeg increments the argument index and finds it has run past argc (no token after -dct); it prints this message and calls usage() which exits. This is a command-line usage error, not a build issue.","triggerScenarios":"Running `cjpeg -dct` as the last token on the command line, with no value following.","commonSituations":"Truncated command lines in shell scripts; a variable that was meant to expand to the DCT method but expanded to empty/nothing.","solutions":["Supply one of the accepted values: `-dct int`, `-dct fast`, or `-dct float`.","Quote/expand shell variables so the DCT method token is actually present."],"exampleFix":"# before\ncjpeg -dct in.ppm > out.jpg\n\n# after\ncjpeg -dct fast in.ppm > out.jpg","handlingStrategy":"validation","validationCode":"# Ensure -dct is always followed by a value before invoking cjpeg.\ncase \"$DCT\" in int|fast|float) : ;; *) DCT=int ;; esac\ncjpeg -dct \"$DCT\" in.ppm > out.jpg","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair -dct with one of int/fast/float.","Default empty shell variables to a valid value before the call."],"tags":["mozjpeg","cjpeg","cli","argument","jpeg"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}