DrKLO/Telegram · info

1. JPEG quality value, 0-100\n

Error message

1. JPEG quality value, 0-100\n

What it means

This is the first descriptive line of yuvjpeg's usage block, printed to stderr as part of the argc != 5 error path: `1. JPEG quality value, 0-100`. It documents argument #1. It is not raised independently; it always follows the `Required arguments:` header (error 191) and precedes lines 193/194.

Source

Thrown at TMessagesProj/jni/mozjpeg/yuvjpeg.c:118

  int frame_height;
  const char *yuv_path;
  const char *jpg_path;
  FILE *yuv_fd;
  size_t yuv_size;
  unsigned char *yuv_buffer;
  JSAMPLE *jpg_buffer;
  struct jpeg_compress_struct cinfo;
  struct jpeg_error_mgr jerr;
  FILE *jpg_fd;
  JSAMPROW yrow_pointer[16];
  JSAMPROW cbrow_pointer[8];
  JSAMPROW crrow_pointer[8];
  JSAMPROW *plane_pointer[3];
  int y;

  if (argc != 5) {
    fprintf(stderr, "Required arguments:\n");
    fprintf(stderr, "1. JPEG quality value, 0-100\n");
    fprintf(stderr, "2. Image size (e.g. '512x512')\n");
    fprintf(stderr, "3. Path to YUV input file\n");
    fprintf(stderr, "4. Path to JPG output file\n");
    return 1;
  }

  errno = 0;

  quality = strtol(argv[1], NULL, 10);
  if (errno != 0 || quality < 0 || quality > 100) {
    fprintf(stderr, "Invalid JPEG quality value!\n");
    return 1;
  }

  matches = sscanf(argv[2], "%dx%d", &luma_width, &luma_height);
  if (matches != 2) {
    fprintf(stderr, "Invalid image size input!\n");
    return 1;

View on GitHub (pinned to 45ab8f4308)

Solutions

  1. Supply a quality argument (integer 0-100) as the first parameter.
  2. Re-read the full usage block (lines 117-120) to construct the correct command.
  3. Validate argument count and types before invoking.
Defensive patterns

Strategy: validation

Validate before calling

/* ensure argument 1 is an integer quality in [0,100] before invoking */
int q = atoi(argv[1]);
if (q < 0 || q > 100) { /* report and do not invoke yuvjpeg */ }

Prevention

When it happens

Trigger: Same as 191: any invocation of yuvjpeg with argc != 5 triggers the whole usage block including this line.

Common situations: Misunderstanding the required argument order; this line tells the user argument 1 must be a quality value in [0,100].

Related errors


AI-assisted analysis of DrKLO/Telegram@45ab8f4308 (2026-08-14). Data as JSON: /api/errors/1c976bf0e7b3f25c. Report an issue: GitHub.