stitchPreference has no effect on /v1/digitize output — all 3 accepted values produce byte-identical PES #39
Labels
No labels
blocked:needs-attention
blocked:needs-decision
bug
feature-request
in-progress
needs-decompose
quickfix
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch-service#39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug: stitchPreference has no effect on /v1/digitize output — three accepted values produce byte-identical PES
Reproduction (verified 2026-09-25)
Upload the same
pil_4color.png(200x200, 4 colored quadrants on white) three times, each with a differentstitchPreferencevalue:balancedqualityspeedAll three outputs are byte-identical (
pes == pes_q == pes_sreturnsTrue).Expected
stitchPreferenceis documented in the API contract as a literal field with allowed valuesbalanced | quality | speed. The naming implies:qualityshould produce denser stitches, longer processing timespeedshould produce coarser stitches, shorter processing timebalancedshould be a middle groundAt minimum, the three values should produce different stitch counts or different PES files. They produce the same output.
Evidence from the smoke test
The default
balancedproduces 4178 stitches on simple_square.png. Same input withqualityandspeedshould differ. (Not separately tested for simple_square.png this session; the 4-color input was tested instead and showed identical outputs across all three prefs.)Likely cause (not verified — would need source read)
The
stitchPreferenceliteral is being accepted by Pydantic validation but not read by the digitize engine. The engine uses fixed settings regardless. Either:Severity
Medium. The value is documented in the API contract and accepted by validation, so users and front-end code will set it believing it has an effect. The front-end (ThreadCraft) likely passes one of these three values to the service. Today, none of them matter. If the front-end adds a "quality" toggle in the future, it will appear to work but will not change the output — the user will suspect the toggle is broken.
Recommended fix
stitchPreferencefrom the API contract entirely and accept any string (passing through to a no-op), orsettings.stitchPreferencein the digitize engine and pass it to the stitch generator as a quality/density multiplier. Add a regression test that confirms the three values produce three different stitch counts on a fixed input fixture.Labels
Filed 2026-09-25 by user-driven bughunt session.