AIGenLab
EN

UPDATEtesseract 5.5.5

Tesseract 5.5.5 fixes nine advisories and finds border text

Version & typev5.5.5 · Feature
In short

This release closes nine security advisories plus crashes, endless loops and timeouts from crafted images and model files. Layout analysis now recovers text inside a scan border, at the image edge, small words between very large lines and rows built from two columns. Column-by-column recognition and bold, italic and underline estimation ship as switches that are off by default, and PDF output carries a valid ToUnicode CMap.

What changed in this release

27 checkpoints in 6 groups, organized by task from the official notes. Checkpoints do not count separate features or commits.

Security and malformed input

  • Nine security advisories fixed, covering crafted images and model files
  • Declared sizes must be backed by remaining bytes (PR #4675)
  • Plumbing child dimensions and the LSTM softmax type validated on load (PR #4671, PR #4670)
  • Strings and byte vectors no longer carry a size limit (PR #4703)
  • Out-of-bounds read on an empty word, gapmap bounds and huge-box blobs fixed (PR #4698, PR #4700, PR #4701)
  • dawg, parameter and classifier robustness fixed (PR #4690, PR #4695, PR #4699)

Layout analysis

  • Text inside a scan border, between leaders and at the image edge is found (PR #4720)
  • A row built from two columns is no longer rejected as noise (PR #4724)
  • Table partitions are merged in pairs (PR #4725)
  • Small words between lines of very large text are recognised (PR #4719)
  • Rows and paragraphs restart from the current block (PR #4721)

Column recognition

  • New -c textord_auto_columns=1 reads newspaper pages column by column (PR #4723)
  • The switch is off by default and must be turned on explicitly

Font attributes

  • New -c lstm_font_attributes=1 estimates bold and italic per word (PR #4712)
  • Underlined words are found from the LSTM result (PR #4722)
  • Attributes are written to hOCR, ALTO and PAGE output (PR #4714)

Output formats

  • The glyphless PDF font gets a valid ToUnicode CMap (PR #4732)
  • Two invalid PAGE XML output cases are fixed (PR #4713)
  • The API still recognises when only layout analysis ran (PR #4694)
  • A missing renderer now returns the right exit code (PR #4669)
  • IsSpaceDelimited is fixed for characters with the null script (PR #4710)

Speed and stability

  • More SIMD functions on ARM64 and x86_64 (PR #4706)
  • functionsavx2.cpp is compiled with AVX2 (PR #4729)
  • The trie indexes back links of the root node (PR #4689)
  • Performance fix on the stats path (PR #4688)
  • A per-page blob budget bounds classifier timeouts (PR #4679)
  • ResizeNoInit stops capping legitimate inference buffers (PR #4674)

Read the original announcement

On this page
  1. Release inventory
  2. Edge text that layout ana…
  3. Nine advisories first
  4. Layout analysis recovers…
  5. Newspaper pages can be re…
  6. Bold
  7. PDF text layer gets a val…
  8. SIMD functions land on AR…
  9. On the same step docTR us…
  10. Against 5.5.4 the weight…
  11. Release analysis
  12. Questions
  13. Sources & method

ContextEdge text that layout analysis used to drop comes back in four places

5.5.5 brings back four kinds of edge text that layout analysis used to drop: a header at the scan border, an entry between leaders, a column at the image edge, small words between huge lines. The usual failure is a missing block, not a wrong character.

Three other areas move: PDF output writes a valid ToUnicode CMap for the glyphless font and fixes two invalid PAGE XML cases, the LSTM gains SIMD on ARM64 and x86_64, and nine advisories close along with crashes and timeouts from malformed files.

The affected pages are concrete: headers and footers on receipts and forms, multi-column newspaper bodies, covers with oversized headings. They used to lose a whole block or read two columns as one line, and no default changes.

The change falls into 6 groups: security and malformed input (6 items), layout (5), column recognition (2), font attributes (3), output formats (5), speed and stability (6). See the figure below; then the two comparison tables and who should move first.

Rows per inventory group: security and speed 6 each, layout and output 5 each, font attributes 3, column recognition 2, 27 in total.
Where the 27 grouped changes landWhere the 27 grouped changes landSecurity and malformed input6Layout analysis5Column recognition2Font attributes3Output formats5Speed and stability6
AIGenLab original

Nine advisories first, and malformed files no longer take the process down

  1. Nine security advisories close, along with crashes, endless loops and timeouts from crafted images or model files.
  2. Parser checks tighten: sizes must be backed by remaining bytes (PR #4675); child dimensions and the softmax type are checked on load (PR #4671).
  3. Bounds close up: an empty word no longer reads out of bounds, and huge-box blobs skip the distance transform (PR #4698, #4701).

Layout analysis recovers four kinds of text it used to miss

  1. Borders and edges: text inside a scan border, between leaders and at the image edge now enters the result (PR #4720).
  2. Between big lines: small words between very large lines are recognised on their own (PR #4719), keeping captions.
  3. Two-column rows: a row built from two columns is no longer noise (PR #4724); table partitions merge in pairs (PR #4725).

Newspaper pages can be read column by column, off by default

  1. Column by column: with -c textord_auto_columns=1 a newspaper page is read column by column (PR #4723).
  2. Off by default: without the flag pages are handled whole; layout-recovered text still enters the result, so trial it per page.

Bold, italic and underline can be estimated per word into hOCR, ALTO and PAGE

  1. Style estimation: with -c lstm_font_attributes=1, recognised words get bold and italic estimates (PR #4712).
  2. Underline separately: underlined words come from the LSTM result (PR #4722) and join the same structured output.
  3. Written into structure: attributes go into ALTO and PAGE (PR #4714), and hOCR carries the same marks.

PDF text layer gets a valid ToUnicode CMap, two PAGE XML cases fixed

  1. PDF: the glyphless font gets a valid ToUnicode CMap (PR #4732), so copy and search no longer return empty maps.
  2. PAGE XML: two invalid output cases are fixed (PR #4713), so downstream parsers can drop compatibility branches.
  3. Output path: the API still recognises when only layout analysis ran (PR #4694), and a missing renderer returns the right exit code (PR #4669).

SIMD functions land on ARM64 and x86_64, with a budget against timeouts

  1. SIMD: more SIMD functions on ARM64 and x86_64 (PR #4706), and functionsavx2.cpp is compiled with AVX2 (PR #4729).
  2. Lookup structures: the trie indexes back links of the root node (PR #4689) and the stats path is faster (PR #4688); rerun your own benchmark.
  3. Timeouts and buffers: a per-page blob budget bounds classifier timeouts (PR #4679), and ResizeNoInit stops capping valid buffers (PR #4674).

On the same step docTR uses a layout model, RapidOCR stops at boxes

The same step looks different elsewhere: Tesseract uses rules inside the engine, docTR a separate layout model, RapidOCR detection plus recognition.

The head starts with the change, then Tesseract 5.5.5, docTR 1.2.0 and RapidOCR 3.10.0. Security and layout differ most.

The short answer: pick Tesseract when a pipeline needs those style fields or a searchable PDF layer, docTR or RapidOCR when boxes plus text suffice.

docTR and RapidOCR both return boxes and text, while style fields and a PDF text layer appear only in the Tesseract column (station's claim, not tested); both are entered through a model, so swapping models is more direct.

ChangeTesseract 5.5.5docTR 1.2.0RapidOCR 3.10.0
SecurityNine advisories, plus crashes and timeouts from malformed inputCheckpoints load with weights_only=True; pickled payloads failtorch weights load with weights_only=True; model SHA256 corrected
LayoutEngine rules; now finds border, leader, edge, big-line-gap and two-column textLayout model (detect_layout=True) returns Title, Text, Table, Page-header, Page-footer; larger lw_detr_mDetection, orientation, recognition; boxes, text, scores, no layout regions
ColumnsNew textord_auto_columns=1 reads column by column, off by defaultReading order follows the layout model, improved in v1.2.0Text follows detection order; no column switch
Font stylelstm_font_attributes=1 estimates bold, italic and underline into hOCR, ALTO and PAGEExports Markdown, HTML, AsciiDoc and JSON; notes list no bold, italic or underline fieldsBoxes, text, scores and elapsed time; no style fields in the docs
PDF layerWrites a PDF text layer with a valid ToUnicode CMap for the glyphless fontReads PDFs and exports Markdown and JSON textTakes images and returns text
SpeedMore SIMD functions on ARM64 and x86_64, AVX2 build, no timing claimv1.2.0 reports faster recognition and an ONNX-exportable decode loopRuns on onnxruntime and reports elapsed time

Against 5.5.4 the weight moves from parser hardening to layout and output

5.5.4 tightened model-file parsing: no zero-input int matrices, no negative or oversized class ids, no malformed dimensions or out-of-range null_char (PR #4644, PR #4640, PR #4649, PR #4642). This release keeps that line and moves its weight to layout and output.

The table head starts with 5.5.4, then 5.5.5; both columns hold only what the notes state. The speed row shows direction only: 5.5.4 removed repeated scans, 5.5.5 adds SIMD and an index.

Both releases put security first and differ in where fixes land: 5.5.4 in parsing and type checks, 5.5.5 in recovered layout and output. If you run 5.5.4, re-accept layout output, not the parsing path.

Area5.5.45.5.5
Advisories17 security advisoriesNine security advisories
Model parsingRejects zero-input int matrices, negative or oversized class ids, malformed dimensions, out-of-range null_char (PR #4644, PR #4640, PR #4649, PR #4642)Sizes must be backed by remaining bytes (PR #4675); child dimensions and softmax type checked on load (PR #4671, PR #4670); string and byte-vector size limit removed (PR #4703)
LayoutPositional paragraph bounding-box fix (PR #4632)Border, leader and edge text (PR #4720), small words between big lines (PR #4719), two-column rows (PR #4724), merged table partitions (PR #4725), column reading (PR #4723)
OutputDouble free and use-after-free in RTL PAGE XML (PR #4647)Valid ToUnicode CMap (PR #4732), two invalid PAGE XML cases (PR #4713), font attributes in ALTO and PAGE (PR #4714)
SpeedNo quadratic paragraph restart scan (PR #4599), no redundant result-iteration restart (PR #4601), per-round seam budget (PR #4659)More SIMD functions (PR #4706), AVX2 build (PR #4729), trie root back-link index (PR #4689), per-page blob budget (PR #4679)

Release analysisTeams behind untrusted uploads upgrade first, fixed templates can wait

Teams running Tesseract behind untrusted input are most affected: uploads, scans and model files share one process, and nine advisories are the reason to upgrade. Next come teams that re-layout from hOCR, ALTO or PAGE; clean images on fixed templates can wait.

docTR hands layout to a separate model and adds a larger lw_detr_m; RapidOCR stays at detection plus recognition. This release repairs rule-based layout misses, a different job.

Our advice: upgrade for security first, sample pages to verify the four kinds of recovered text, then enable textord_auto_columns and lstm_font_attributes; both ship off by default. Station's claims, not independent tests.

Acceptance runs in three steps: replay the untrusted samples to confirm nothing crashes, sample newspaper pages and forms to compare line counts and reading order, then flip the switches and record new output fields.

AIGenLab views

Not independently tested

For teams that run Tesseract behind untrusted uploads, the reason to upgrade is the nine security advisories and the malformed-input fixes; the recovered text is a secondary gain.

Based on the first paragraph of the release notes and the deserialisation checks in the change list; the station ran no penetration or fuzz testing.

textord_auto_columns and lstm_font_attributes are off by default and do nothing unless enabled; the text layout analysis recovers is not gated by either switch and changes the result, so whether the switches are worth enabling has to be sampled on your own pages.

The release notes state the two switches are new and off by default, while the text layout analysis recovers (PR #4720, #4719, #4724) is not gated by a switch; the station did not run a before-and-after comparison on its own corpus.

At the layout step Tesseract uses rules inside the engine while docTR uses a separate layout model, so the two cannot be ranked by cell count; when a pipeline needs style fields, only Tesseract writes them into hOCR, ALTO and PAGE directly.

Compared against the docTR v1.2.0 notes and README sections on layout regions and export structure; the station did not run both tools on the same page batch.

Questions

Is this release worth upgrading for steadier recognition alone?
Yes, but mainly for security: nine advisories plus crashes, endless loops and timeouts from crafted images or model files are fixed here, while recognition accuracy is not the focus.
Should the two new switches be turned on right away?
Not immediately. Column-by-column recognition and font-attribute estimation ship off by default; trial them on newspaper pages or forms, compare line counts, reading order and the ALTO and PAGE fields, then enable them once downstream consumers cope.
Will existing hOCR, ALTO or PAGE results change after the upgrade?
With the switches off, style attributes are not computed; the recovered text does enter the result, so compare by running the same page batch on both versions.

Official sources and scope

  • Tesseract 5.5.5 release notes Version, release date, nine advisories, the four kinds of recovered text, the two opt-in switches and the SIMD change
  • Tesseract 5.5.4 release notes The previous-release side of the vertical table: 17 advisories, parser hardening, and the repeated-scan fixes in paragraph restart and result iteration
  • Tesseract 5.5.4 to 5.5.5 full changelog The full change range between the two releases, used to confirm the inventory covers the listed items
  • docTR v1.2.0 release notes Horizontal comparison: layout model and lw_detr_m, reading-order improvement, checkpoints loaded with weights_only=True, export formats
  • docTR README Horizontal comparison: layout region types, the Page/Block/Line/Word structure, and Markdown and JSON exports
  • RapidOCR v3.10.0 release notes Horizontal comparison: torch weights loaded with weights_only=True to prevent code execution, and the corrected model SHA256
  • RapidOCR quick start Horizontal comparison: output fields of boxes, text, scores and elapsed time across detection, orientation classification and recognition

Dates beside sources indicate when we consulted them, not when the vendor released the update. Procedures are editorial guidance, not independently tested.