Camera view: wait 2.5 s of a still, readable band before the photo
CI / secret scan (push) Successful in 7s
CI / fmt, clippy, tests (push) Successful in 36s
CI / release (push) Skipped

On a phone the camera view took the photo too soon: a second of a
readable band, while the hand still moved. Now it takes the photo by
itself only when the band has looked readable and the picture has stood
still (mean change of a band pixel between checks under 6 of 255) for ten
checks in a row, 2.5 s, and never in the first 1.5 s. The hint counts
down ("the photo is taken in 2 s, or press Take the photo"), and says
"Hold still: the picture still moves" while it moves. Take the photo
still takes it at once.

Checked with fake cameras in Edge at 390x844: glare and dark keep their
hints and never take a photo, a feed that moves is never taken in 8 s, a
still good one is taken after 4.0 s and read with every check digit.
This commit is contained in:
grabowski committed 2026-11-20 19:34:47 +07:00
1 parent 0d3b2d8b84
commit a6ebdfc89c
2 files changed
+50 -12

No files matched your search

+5 -3
View File
@@ -453,9 +453,11 @@ Planned on November 20, 2026, from Alex's answers (decisions table).
reuse `templates/_mrz_photo.html`). "Take a photo" opens a camera view:
a frame of the photo page's shape and a band for the two lines, with
a hint that says when it is too dark, when there is glare on the
lines, when no lines are in the band or the picture is not sharp, and
that takes the photo by itself once the band has looked readable for
a second. "Choose a picture" reads any image (EXIF orientation, the
lines, when no lines are in the band, the picture is not sharp or
still moves, and that takes the photo by itself once the band has
looked readable and stood still for 2.5 seconds (never in the first
1.5 seconds; a second was too quick on a phone, Nov 20), counting
down in the hint; "Take the photo" takes it at once. "Choose a picture" reads any image (EXIF orientation, the
four quarter turns, a tilt either way). Reading happens in the browser
(`static/mrz-photo.js`): Tesseract.js 7 with Doubango's MRZ model, all
served by the app (`static/vendor/tesseract/README.txt`, about 6 MB,