{"record":{"id":"5a132b7af10eadae","repo":"DrKLO/Telegram","slug":"gif-input-is-unsupported-for-legal-reasons-sorry","errorCode":null,"errorMessage":"GIF input is unsupported for legal reasons.  Sorry.\n","messagePattern":"GIF input is unsupported for legal reasons\\.  Sorry\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"TMessagesProj/jni/mozjpeg/rdgif.c","lineNumber":34,"sourceCode":" *\n * We are required to state that\n *    \"The Graphics Interchange Format(c) is the Copyright property of\n *    CompuServe Incorporated. GIF(sm) is a Service Mark property of\n *    CompuServe Incorporated.\"\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef GIF_SUPPORTED\n\n/*\n * The module selection routine for GIF format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_gif(j_compress_ptr cinfo)\n{\n  fprintf(stderr, \"GIF input is unsupported for legal reasons.  Sorry.\\n\");\n  exit(EXIT_FAILURE);\n  return NULL;                  /* keep compiler happy */\n}\n\n#endif /* GIF_SUPPORTED */\n","sourceCodeStart":16,"sourceCodeEnd":40,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/rdgif.c#L16-L40","documentation":"The jinit_read_gif function in rdgif.c is a stub that always prints this message and calls exit(EXIT_FAILURE). Although GIF_SUPPORTED is a compile-time macro, the function body contains no actual GIF decoding logic -- it is intentionally disabled for legal/licensing reasons (GIF uses LZW compression, which was historically patent-encumbered). Any attempt to read a GIF file through the cjpeg input pipeline triggers this hard exit.","triggerScenarios":"Calling jinit_read_gif() (selected as the cjpeg input module when the input file is detected as GIF), or running cjpeg on a .gif file when this mozjpeg build compiles with GIF_SUPPORTED defined but without a real GIF reader implementation.","commonSituations":"A build configuration that defines GIF_SUPPORTED without linking a real GIF library; attempting to convert GIF images to JPEG using cjpeg from this mozjpeg fork; automated image processing pipelines that feed GIF files into the JPEG encoder.","solutions":["Convert GIF images to an intermediate format (PNG, BMP, PPM) using an external tool (ImageMagick, giflib) before feeding them to cjpeg.","Do not enable GIF_SUPPORTED in the build configuration unless a real GIF reader implementation is provided.","If GIF input is needed, patch rdgif.c to use a real GIF decoding library (e.g., giflib) instead of the stub."],"exampleFix":"# before\ncjpeg input.gif > output.jpg\n# after\nconvert input.gif input.png\ncjpeg input.png > output.jpg","handlingStrategy":"validation","validationCode":"# Check file type before passing to cjpeg\nif file \"$input\" | grep -qi gif; then\n  convert \"$input\" \"${input%.*}.png\"\n  input=\"${input%.*}.png\"\nfi\ncjpeg \"$input\" > output.jpg","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the input file format with the file command before passing to cjpeg.","Pre-convert GIF files to PNG or PPM using ImageMagick or giflib.","Avoid defining GIF_SUPPORTED in the build unless a real reader is linked."],"tags":["gif","unsupported-format","licensing","mozjpeg","exit"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}