EmbroideryPipeline.process() should accept raster bytes, not require a file path #33
Labels
No labels
blocked:children
blocked:depends-101
blocked:depends-103
blocked:depends-104
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:preflight
bug
chore
feature-request
in-progress
lint-cleanup
needs-decompose
performance
quality
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch#33
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?
Inefficiency / API friction
EmbroideryPipeline.process(input_path: Path, ...)requires a file on disk.For an HTTP service (see "Add HTTP service layer"), every request would have
to write the uploaded raster to a temp file, call
process(), read theoutput, then clean up. That's:
Proposal
Add a
process_bytes(data: bytes, **kwargs)method (or a parallelprocess()overload) that takes the input bytes directly. Internally, useio.BytesIOto satisfy the raster/SVG readers without touching disk.The existing
process(input_path)stays for CLI compatibility and isre-implemented as
process_bytes(Path(input_path).read_bytes(), ...).Acceptance
process_bytes(b"\x89PNG...\r\n", output_format="dst")returns the sameresult as writing the bytes to a temp file and calling
process().process_bytes()don't interfere with each other.process_bytes()directly without disk I/O.Cross-link: ThreadCraft #11 — unblocks the wrapper's ability to call process() with bytes instead of file paths.