{"record":{"id":"c9edbbc9413e1f51","repo":"DrKLO/Telegram","slug":"s-sorry-in-memory-source-manager-was-not-compil","errorCode":null,"errorMessage":"%s: sorry, in-memory source manager was not compiled in\n","messagePattern":"(.+?): sorry, in-memory source manager was not compiled in\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"TMessagesProj/jni/mozjpeg/djpeg.c","lineNumber":377,"sourceCode":"      /* Use fast one-pass quantization. */\n      cinfo->two_pass_quantize = FALSE;\n\n    } else if (keymatch(arg, \"os2\", 3)) {\n      /* BMP output format (OS/2 flavor). */\n      requested_fmt = FMT_OS2;\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      outfilename = argv[argn]; /* save it away for later use */\n\n    } else if (keymatch(arg, \"memsrc\", 2)) {\n      /* Use in-memory source manager */\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n      memsrc = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, in-memory source manager was not compiled in\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"pnm\", 1) || keymatch(arg, \"ppm\", 1)) {\n      /* PPM/PGM output format. */\n      requested_fmt = FMT_PPM;\n\n    } else if (keymatch(arg, \"rle\", 1)) {\n      /* RLE output format. */\n      requested_fmt = FMT_RLE;\n\n    } else if (keymatch(arg, \"scale\", 2)) {\n      /* Scale the output image by a fraction M/N. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (sscanf(argv[argn], \"%u/%u\",\n                 &cinfo->scale_num, &cinfo->scale_denom) != 2)","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/djpeg.c#L359-L395","documentation":"djpeg emits this when the -memsrc switch is supplied but the build does not support an in-memory JPEG source manager: JPEG_LIB_VERSION is below 80 AND MEM_SRCDST_SUPPORTED is not defined. The switch is recognized, this message prints, and the process exits with EXIT_FAILURE. It is a build/version configuration mismatch.","triggerScenarios":"Running djpeg with -memsrc on a libjpeg/mozjpeg build older than v80 that was not compiled with MEM_SRCDST_SUPPORTED.","commonSituations":"Using an older distro libjpeg (pre-8.0) or a minimal build that omitted the memory source/dst optional feature; expecting turbo/mozjpeg features on a vanilla libjpeg build.","solutions":["Recompile with JPEG_LIB_VERSION >= 80 or with MEM_SRCDST_SUPPORTED defined (libjpeg-turbo and mozjpeg enable this by default).","If you cannot rebuild, stop using -memsrc and read the JPEG from a regular file or stdin instead.","Verify the rebuilt binary supports it: djpeg -memsrc on a test input should no longer exit with this message."],"exampleFix":"# before\ndjpeg -memsrc in.jpg > out.ppm\n# after (rebuild with MEM_SRCDST_SUPPORTED, then)\ndjpeg -memsrc in.jpg > out.ppm\n# or, if you cannot rebuild, use a file/stdin:\ndjpeg in.jpg > out.ppm","handlingStrategy":"validation","validationCode":"#!/bin/sh\n# Probe whether this djpeg build supports -memsrc\nif printf '' | djpeg -memsrc 2>&1 | grep -q 'in-memory source manager was not compiled in'; then\n  echo 'this djpeg lacks -memsrc support; rebuild or use file/stdin' >&2; exit 1\nfi\ndjpeg -memsrc in.jpg > out.ppm","typeGuard":"// n/a: build-capability probe in the caller.","tryCatchPattern":"if ! djpeg -memsrc in.jpg > out.ppm 2>/tmp/e; then\n  grep -q 'in-memory source manager was not compiled in' /tmp/e && { echo 'rebuild with MEM_SRCDST_SUPPORTED or JPEG_LIB_VERSION>=80' >&2; exit 1; }\nfi","preventionTips":["Document the libjpeg version and feature macros of the deployed binary.","In CI, probe optional features before shipping code that uses them.","Prefer file/stdin input when the build's memory-source support is unverified."],"tags":["mozjpeg","djpeg","build-config","compile-time","memsrc"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}