{"record":{"id":"8a3eb7edf99c8732","repo":"DrKLO/Telegram","slug":"2-image-size-e-g-512x512-n","errorCode":null,"errorMessage":"2. Image size (e.g. '512x512')\\n","messagePattern":"2\\. Image size \\(e\\.g\\. '512x512'\\)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"TMessagesProj/jni/mozjpeg/yuvjpeg.c","lineNumber":119,"sourceCode":"  const char *yuv_path;\n  const char *jpg_path;\n  FILE *yuv_fd;\n  size_t yuv_size;\n  unsigned char *yuv_buffer;\n  JSAMPLE *jpg_buffer;\n  struct jpeg_compress_struct cinfo;\n  struct jpeg_error_mgr jerr;\n  FILE *jpg_fd;\n  JSAMPROW yrow_pointer[16];\n  JSAMPROW cbrow_pointer[8];\n  JSAMPROW crrow_pointer[8];\n  JSAMPROW *plane_pointer[3];\n  int y;\n\n  if (argc != 5) {\n    fprintf(stderr, \"Required arguments:\\n\");\n    fprintf(stderr, \"1. JPEG quality value, 0-100\\n\");\n    fprintf(stderr, \"2. Image size (e.g. '512x512')\\n\");\n    fprintf(stderr, \"3. Path to YUV input file\\n\");\n    fprintf(stderr, \"4. Path to JPG output file\\n\");\n    return 1;\n  }\n\n  errno = 0;\n\n  quality = strtol(argv[1], NULL, 10);\n  if (errno != 0 || quality < 0 || quality > 100) {\n    fprintf(stderr, \"Invalid JPEG quality value!\\n\");\n    return 1;\n  }\n\n  matches = sscanf(argv[2], \"%dx%d\", &luma_width, &luma_height);\n  if (matches != 2) {\n    fprintf(stderr, \"Invalid image size input!\\n\");\n    return 1;\n  }","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/yuvjpeg.c#L101-L137","documentation":"Second descriptive line of yuvjpeg's usage block: `2. Image size (e.g. '512x512')`. Documents argument #2 (luma dimensions in WxH form). Printed only on the argc != 5 error path alongside 191/192/194.","triggerScenarios":"Same trigger as 191: yuvjpeg invoked with argc != 5.","commonSituations":"Confusing the size format; this line specifies the expected `WxH` syntax (no 'x' variants, no spaces).","solutions":["Pass image size as a single WxH token, e.g. 512x512.","Ensure width and height match the actual YUV frame dimensions.","Validate the size token matches the regex ^[0-9]+x[0-9]+$ before invoking."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"#include <regex.h>\n/* size must be WxH before invoking yuvjpeg */\nregex_t re; regcomp(&re, \"^[0-9]+x[0-9]+$\", REG_EXTENDED);\nif (regexec(&re, size_arg, 0, NULL, 0) != 0) { /* reject */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Format size as lowercase WxH with no spaces.","Validate the size token against ^[0-9]+x[0-9]+$ upstream.","Make sure W,H match the real YUV frame."],"tags":["cli","jpeg","mozjpeg","yuvjpeg","usage","documentation"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}