Image pipeline: resize + compress on upload #26
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
posta/server#26
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?
Why
`POST /api/v1/uploads` (#22) stores bytes verbatim with a 10 MiB cap.
Phones routinely produce 4-12 MP photos that are 3-6 MiB even encoded
as JPEG; recipients on mobile data pay for that bandwidth twice
(uploader pushes, recipient pulls). A server-side pipeline that:
…would bring typical photo uploads to ~200-500 KiB without visible
quality loss in chat.
Scope considerations
pipeline opens up to other media (e.g. video, PDFs) later, the
encoder selection becomes per-mediatype.
reflects the post-pipeline bytes, not the uploaded bytes. Clients
must use the response URL — they already do.
A decode/re-encode round-trip drops most metadata for free, but
belt-and-suspenders is fine.
that the stored file will be smaller.
Out of scope
Acceptance
long edge.
quality preserved.
Related: #22.