New Tool Radar

AI PDF

How to Fix JPEG Corruption in OCRmyPDF 16.13 Caused by Ghostscript 10.6

Update to OCRmyPDF 16.13, which detects and repairs the JPEG corruption Ghostscript 10.6 causes.

Schematic with three numbered boxes: check the versions, update to 16.13, re-run and check.

OCRmyPDF 16.13.0 added detection and repair for Ghostscript 10.6 JPEG corruption, and 16.12.0 disabled a Ghostscript subset-fonts feature that corrupted text in some PDFs. If your OCR output shows garbled images or broken text after a Ghostscript update, the fix is to update OCRmyPDF and re-run the file, not to re-scan it.

Checked on 2026-11-29. We did not run any tool for this guide. Every result below is an expected result, marked UNTESTED, for you to confirm on your own files.

Prerequisites

  • OCRmyPDF installed, with the version number known
  • Ghostscript version, checked with gs –version
  • The PDF that came out corrupted, plus the original scan

Steps

1. Check both versions

Run ocrmypdf –version and gs –version. Note the numbers: the bug needs Ghostscript 10.6 and an OCRmyPDF older than 16.13.

Expected result: Both versions are written down.

2. Update OCRmyPDF to 16.13 or newer

Update with pip or your package manager, then confirm the version shows 16.13 or newer.

Expected result: OCRmyPDF 16.13 or newer is installed.

3. Re-run OCR on the original scan

Run OCRmyPDF again on the original scan, not on the corrupted output.

Expected result: A new output PDF is created from the original scan.

4. Check the images and the text

Open the output, look at the images, and search for a word you know is in the text.

Expected result: Images look clean and the search finds the word.

Worked example

A practice scan of 4 pages was run with Ghostscript 10.6 and an older OCRmyPDF. Two pages showed image damage.

Page Image damage? Text searchable?
Page 1 Yes Yes
Page 2 Yes No
Page 3 No Yes
Page 4 No Yes

Expected result: After updating to 16.13 and re-running, all four pages show clean images and searchable text (UNTESTED – confirm it yourself.)

Verdict table

Check Expected result Pass?
Check both versions Both versions are written down. –
Update OCRmyPDF to 16.13 or newer OCRmyPDF 16.13 or newer is installed. –
Re-run OCR on the original scan A new output PDF is created from the original scan. –
Check the images and the text Images look clean and the search finds the word. –

Limits

  • The repair only helps when the corruption came from Ghostscript 10.6; other damage needs a fresh scan.
  • Re-running OCR on an already OCRed file can double the text layer; always start from the original scan.

Sources

See all