DrKLO/Telegram · error

%s: sorry, progressive output was not compiled

Error message

%s: sorry, progressive output was not compiled

What it means

The -progressive flag was given but the build lacks C_PROGRESSIVE_SUPPORTED, so progressive JPEG output is unavailable. jpegtran exits with failure at parse time.

Source

Thrown at TMessagesProj/jni/mozjpeg/jpegtran.c:313

    } else if (keymatch(arg, "outfile", 4)) {
      /* Set output file name. */
      if (++argn >= argc)       /* advance to next argument */
        usage();
      outfilename = argv[argn]; /* save it away for later use */

    } else if (keymatch(arg, "perfect", 2)) {
      /* Fail if there is any partial edge MCUs that the transform can't
       * handle. */
      transformoption.perfect = TRUE;

    } else if (keymatch(arg, "progressive", 2)) {
      /* Select simple progressive mode. */
#ifdef C_PROGRESSIVE_SUPPORTED
      simple_progressive = TRUE;
      prefer_smallest = FALSE;
      /* We must postpone execution until num_components is known. */
#else
      fprintf(stderr, "%s: sorry, progressive output was not compiled\n",
              progname);
      exit(EXIT_FAILURE);
#endif

    } else if (keymatch(arg, "restart", 1)) {
      /* Restart interval in MCU rows (or in MCUs with 'b'). */
      long lval;
      char ch = 'x';

      if (++argn >= argc)       /* advance to next argument */
        usage();
      if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
        usage();
      if (lval < 0 || lval > 65535L)
        usage();
      if (ch == 'b' || ch == 'B') {
        cinfo->restart_interval = (unsigned int)lval;
        cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */

View on GitHub (pinned to 45ab8f4308)

Solutions

  1. Omit -progressive; output will be baseline.
  2. Rebuild libjpeg-turbo/mozjpeg with C_PROGRESSIVE_SUPPORTED (ensure jpegparam.h / CMake sets it, default is on for turbo/mozjpeg).
  3. Detect the feature via a build-time probe and skip the flag when unsupported.
  4. Post-process with a tool known to support progressive output if a rebuild is impossible.

Example fix

# before
./jpegtran -progressive in.jpg > out.jpg
# after
./jpegtran in.jpg > out.jpg   # or rebuild with C_PROGRESSIVE_SUPPORTED
Defensive patterns

Strategy: type-guard

Type guard

#ifndef C_PROGRESSIVE_SUPPORTED
#error "progressive output unavailable; do not pass -progressive"
#endif

Prevention

When it happens

Trigger: Passing -progressive to a libjpeg/mozjpeg build where progressive encoding was disabled at compile time. The flag is parsed but routed to the #else failure branch.

Common situations: Baseline-only embedded libjpeg builds, size-optimized distributions, or a CMake build with progressive output disabled. Tutorials that recommend -progressive fail on such builds.

Related errors


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