← Dolaima← Docs indexCode from a picture原文中文

Code from a picture

Turn code in a photo into plain text and insert it at the caret — a computer screen, a book page, or another phone all work.

Where: the editor toolbar's 📷 Code in photo (or the item of the same name in the ☰ menu).

The whole flow

  1. Put the caret where the code should go (an existing selection is replaced)
  2. Tap 📷 Code in photo, then pick the source: Camera or Gallery
  3. The picture opens in a crop step: drag a box around just the code, then confirm
  4. The boxed area is sent to the model (the screen shows "Reading code from the picture…")
  5. The result is handled automatically — see the three cases below

Crop first, recognise second is deliberate: when the shot includes a desk, your hand or the background, only what is inside the box is read. Loose boxes tend to pull book titles, page numbers and watermarks into the result.

Three possible outcomes

CaseWhat happens
Everything recognisedInserted directly, with a "Inserted N line(s)" toast
Some characters unclearA dialog shows the result and you decide; check the □ marks afterwards
No code in the pictureOnly a "No code found" message — nothing is inserted

The third case is guarded on purpose: when the model finds no code it tends to answer with a sentence ("Sorry, there is no code in this picture"), and inserting that would write junk into your source file.

What the □ means

**Unclear characters are marked □ instead of being guessed.**

The usual confusions in code are 0/O, 1/l/I, {/}, (/() and ;/:. One wrong character can shift the compile error by several lines — □ shows you exactly which spot to check.

A vision-capable model is required

Photo reading uses the current model's vision ability. Models marked Vision in the model catalog work reliably; unsupported ones surface the server's own message (for example model does not support image input) instead of a vague "failed".

Recognition gives up after 120 seconds and reports a timeout.

Common questions