{"record":{"id":"e6dd62c6a898eee3","repo":"ocrmypdf/OCRmyPDF","slug":"ghostscript-gs-version-contains-serious-regressi","errorCode":null,"errorMessage":"Ghostscript {gs_version} contains serious regressions and is not supported. Please upgrade to a newer version.","messagePattern":"Ghostscript (.+?) contains serious regressions and is not supported\\. Please upgrade to a newer version\\.","errorType":"validation","errorClass":"MissingDependencyError","httpStatus":null,"severity":"error","filePath":"src/ocrmypdf/builtin_plugins/ghostscript.py","lineNumber":196,"sourceCode":"    # Use the model's CLI generation method\n    GhostscriptOptions.add_arguments_to_parser(parser)\n\n\n@hookimpl\ndef check_options(options):\n    \"\"\"Check that the options are valid for this plugin.\"\"\"\n    # Only require Ghostscript for pdfa* output types (not 'auto' or 'pdf')\n    # 'auto' mode uses best-effort PDF/A without Ghostscript fallback\n    if options.output_type.startswith('pdfa'):\n        check_external_program(\n            program='gs',\n            package='ghostscript',\n            version_checker=ghostscript.version,\n            need_version='9.54',  # RHEL 9's version; Ubuntu 22.04 has 9.55\n        )\n        gs_version = ghostscript.version()\n        if gs_version in BLACKLISTED_GS_VERSIONS:\n            raise MissingDependencyError(\n                f\"Ghostscript {gs_version} contains serious regressions and is not \"\n                \"supported. Please upgrade to a newer version.\"\n            )\n        if Version('10.0.0') <= gs_version < Version('10.02.1') and (\n            options.mode in (ProcessingMode.skip, ProcessingMode.redo)\n        ):\n            raise MissingDependencyError(\n                f\"Ghostscript 10.0.0 through 10.02.0 (your version: {gs_version}) \"\n                \"contain serious regressions that corrupt PDFs with existing text, \"\n                \"such as those processed using --skip-text or --redo-ocr \"\n                \"(or --mode skip/redo). Please upgrade to a newer version, or use \"\n                \"--output-type pdf to avoid Ghostscript, or use --force-ocr \"\n                \"(or --mode force) to discard existing text.\"\n            )\n        if ghostscript.jpeg_truncation_bug(gs_version):\n            log.warning(\n                \"Ghostscript %s contains JPEG encoding errors that may corrupt \"\n                \"images. OCRmyPDF will attempt to mitigate, but this version is \"","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/ocrmypdf/OCRmyPDF/blob/5074a0b0e109362422b768fd271ed84bf717c4ec/src/ocrmypdf/builtin_plugins/ghostscript.py#L178-L214","documentation":"The Ghostscript plugin's check_options() runs a version blacklist before processing. Ghostscript releases listed in BLACKLISTED_GS_VERSIONS are known-broken enough that ocrmypdf refuses to use them at all, regardless of options.","triggerScenarios":"Invoking ocr() (or any pipeline run) on a machine whose `gs --version` reports one of the blacklisted releases.","commonSituations":"Distro packages or CI images pinning a defective Ghostscript build; upgrading the OS and inheriting a bad version.","solutions":["Upgrade Ghostscript to a non-blacklisted release (e.g. current 10.x) via your package manager.","In containers/CI, install an up-to-date Ghostscript in the image instead of relying on the base distro version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from ocrmypdf.builtin_plugins.ghostscript import BLACKLISTED_GS_VERSIONS\nfrom ocrmypdf.builtin_plugins import ghostscript\nv = ghostscript.version()\nassert v not in BLACKLISTED_GS_VERSIONS, f'blacklisted Ghostscript {v}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check Ghostscript version in CI before running ocrmypdf.","Pin a known-good Ghostscript in container images."],"tags":["ocrmypdf","ghostscript","version-blacklist","dependency"],"backgroundTag":"unsupported-dependency-version","analyzedSha":"5074a0b0e109362422b768fd271ed84bf717c4ec","analyzedAt":"2026-08-27T11:57:38.523Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}