{"record":{"id":"adaa786f94df20b4","repo":"DrKLO/Telegram","slug":"s-missing-argument-for-dc-scan-opt","errorCode":null,"errorMessage":"%s: missing argument for dc-scan-opt\n","messagePattern":"(.+?): missing argument for dc-scan-opt\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"TMessagesProj/jni/mozjpeg/cjpeg.c","lineNumber":404,"sourceCode":"        usage();\n      icc_filename = argv[argn];\n\n    } 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, \"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);","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/cjpeg.c#L386-L422","documentation":"The -dc-scan-opt switch requires a following integer argument (the DC scan optimization mode, passed to jpeg_c_set_int_param with JINT_DC_SCAN_OPT_MODE via atoi). cjpeg finds no token after -dc-scan-opt, prints this message, and calls usage() which exits.","triggerScenarios":"Running `cjpeg -dc-scan-opt` with no value following, or as the last token.","commonSituations":"Truncated command line; a shell variable for the mode that expanded to nothing.","solutions":["Supply an integer mode value, e.g. `cjpeg -dc-scan-opt 1 ...`.","Ensure the variable holding the mode is non-empty before invoking cjpeg."],"exampleFix":"# before\ncjpeg -dc-scan-opt in.ppm > out.jpg\n\n# after\ncjpeg -dc-scan-opt 1 in.ppm > out.jpg","handlingStrategy":"validation","validationCode":"# Ensure -dc-scan-opt has a non-empty integer argument.\ncase \"$DCSCAN\" in ''|*[!0-9-]*) DCSCAN=1 ;; esac\ncjpeg -dc-scan-opt \"$DCSCAN\" in.ppm > out.jpg","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an integer after -dc-scan-opt.","Default the mode variable to a sane value."],"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"}