mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-08-02 00:19:21 -04:00
A page may carry an optional /Thumb image XObject (ISO 32000-2 12.3.4), a miniature rendering used only as a navigation aid. OCRmyPDF alters page appearance (deskew, clean, rasterize, re-render) and plugins may edit pages arbitrarily, so a retained thumbnail would be stale and no longer match its page. Modern viewers generate thumbnails on demand, so there is no loss of functionality. OcrGrafter.finalize() now strips /Thumb from every page before saving, alongside the existing search-index discard, covering both the OCR and hOCR pipelines. Orphaned thumbnail XObjects are garbage-collected on save.