ocr
Reads the text in one image with Tesseract, inside the job’s box. Nothing leaves the machine: no model, no service.
What the operator configures
The keys are in config.yaml: the languages, the largest image (max_pixels),
the side it is scaled to (max_edge) and the box’s limits. ocr has no destination and no
secret.
Tesseract comes in the ocr box’s image, with only the configured languages. Nothing needs to be
installed on the machine. After changing languages, run sandcastle install to build the image
again; until then check fails, saying both lists.
What the job fills
{"image": "<the bytes of one image, in base64>"}
One image per job, as JPEG, PNG or WebP. A job cannot name a URL, a program, an argument or a path.
What the job gets back
{"text": "<the text that was read>"}
text is empty when the image holds no text.
What happens to the image
The box decodes the image itself, and draws it anew before Tesseract reads it. So Tesseract and its image library only ever parse a bitmap sandcastle made, never the bytes that came in the job.
- A file that is not JPEG, PNG or WebP fails the job.
- An image of more than
max_pixelsfails the job before it is decoded. - An image with a side longer than
max_edgeis scaled down first.
The core never opens the input. The job’s record keeps the image’s size and the SHA-256 of its bytes, never the bytes, so the image does not stay behind after the reading.
What check proves
check starts a box that runs tesseract --list-langs, and fails when a configured language is
missing.