Should a wedding-photography app compress or transcode photos and video on the phone before uploading, and when must it send the untouched originals?
answer
- who needs the full quality?
- lossy re-encoding cannot be undone
- bytes saved against battery, heat, time
- write the output to a file
- a small preview now, originals later
basics
~20 sCompress only uploads meant for viewing: it saves data and time but costs battery, heat and disk, and a lossy re-encode cannot be undone. A studio's deliverables are its originals, so send those untouched, perhaps after a preview.
solid answer
~50 sIt depends on who needs the bytes. For a guest sharing phone snaps, re-encoding on the device to a sensible resolution and bitrate saves cellular data and upload time, and the server makes display sizes anyway. For a studio, the full-resolution photos and clips are the deliverable the couple paid for; a lossy re-encode throws away detail that can never be recovered, so the app uploads the originals untouched. Transcoding is not free: it delays the first byte, drains the battery, heats the phone, and its output needs disk space until the upload commits. A strong middle path is two passes — a small preview first so the gallery fills quickly, the originals later, by default on Wi-Fi and while charging. Any prepared file is written to disk and tracked as a queue step, so an interrupted transcode restarts cleanly.
go deeper
Recall that lossy compression saves bytes but permanently discards detail, so whether to compress depends on what the uploaded file is for.
Explain the trade: data and time saved against battery, heat, delay before upload and disk for the output, and why that output is a file the queue tracks.
Show judgment on the two-pass pattern, deferring originals to Wi-Fi and charging, and handling a transcode the OS interrupts without uploading a half-written file.
Set a media-upload policy across features: which may re-encode, to what quality, when originals are mandatory, and what the server rather than the client produces.
## Who the bytes are for Whether to compress on the phone is a product question before it is a technical one. The same app can carry several kinds of upload: | Upload | Compress on the phone? | Why | |---|---|---| | The studio's deliverables — full-resolution photos and ceremony clips | **No; send the originals untouched** | they are what the couple paid for; a lossy re-encode discards detail that can never be recovered | | A quick preview so the couple sees the first dance the same evening | **Yes, a small copy** | the point is speed on a weak signal; the original follows later | | Guests' phone snaps shared into the gallery | **Usually yes** | viewing quality is enough, and it saves each guest's data plan and time | | The display sizes and formats the gallery shows | **Not the phone's job** | the server derives them once from one upload, for every screen and app version | **Lossy** compression — JPEG, HEIC, a lower video bitrate — throws information away for good; **lossless** compression saves little on JPEG, HEIC or video files, which are already compressed. So on-device work that saves real bytes on them is almost always lossy, which is exactly what a professional's originals must not suffer. ## What compressing on the device costs - **Time before the first byte moves.** A long clip must be read, decoded and re-encoded before its upload can begin. - **Battery and heat.** Video encoding is heavy work, and a phone in a pocket at a summer wedding is already warm; one platform documents stopping long transfer jobs when the device's thermal state rises. - **Disk.** The output is a second file. A resumable upload needs it kept, unchanged, until the server commits, so the queue owns that space. - **A step that can itself be interrupted.** A transcode stopped halfway leaves an unusable partial file. The benefit is the bytes saved. Suppose re-encoding takes the 2 GB clip to about 400 MB — an assumption for illustration; the real ratio depends on the codec and target bitrate. On a venue uplink of 2 Mbit/s (also an assumption), and counting 2 GB as 2,000 MB, that is about 27 minutes instead of 2 hours 13 minutes. That is a real win for a preview, and an irrelevant one for originals the couple will print. ## Preparing is a step in the queue When an upload is re-encoded, the queue gains a state between `waiting` and `uploading`: 1. **waiting** — the source is referenced; nothing produced yet. 2. **preparing** — the encoder writes its output to a file in the app's own storage, never to memory alone. 3. **Output complete** — the entry records the output's size and hash and pins the file; only now may it move on. 4. **uploading** — the transfer reads from that pinned file. Writing to a file is not optional. On one platform a transfer handed to the OS's background-transfer service must upload **from a file**; an upload fed from in-memory data or a stream fails once the app exits. On every platform a file is what survives a relaunch. If preparation is interrupted, the partial output is deleted and the step restarts; a half-written file is never handed to the upload, because the server would store a broken clip. ## The two-pass pattern For a studio app the strongest design usually sends **both**, in a deliberate order: 1. **A small preview copy** of each selected photo or clip goes first, on any network, so the couple's gallery fills within the evening. 2. **The originals** follow, by default only on Wi-Fi and while charging, unless the photographer overrides that for an urgent delivery. The server swaps each preview for versions derived from the original once the original commits. The client's job ends at sending the two files; deriving display sizes, choosing formats per screen and building a video's playback renditions belong to the server and to the subjects that cover image variants and media delivery. ## How to say it in the room - **Purpose first:** "these are deliverables, so originals; previews may be compressed". - **Then the costs of on-device work:** time, battery, heat, disk and interruptions. - **Then the shape:** a preview pass for speed, an originals pass under a network and power policy, and every prepared file treated as a pinned, resumable item in the queue. - **And the boundary:** one upload per file from the phone; every other size is the server's.
- The OS stops the app halfway through transcoding a long clip; what should the queue do?Leave the entry in `preparing`, delete the partial output and restart the transcode the next time the app may do heavy work. A half-written video is never handed to the upload, because the server would store a broken file. Long encodes run under the OS's background-work limits, so the queue must expect this interruption, not treat it as a failure.
- Should the phone upload several sizes of each photo so the gallery loads quickly on every screen?No. The phone sends one file per photo; the server derives display sizes and formats from it once, consistently, and can add new ones later for new screens or app versions. Making them on the phone spends the photographer's data, battery and time on work the server does better.
- Compressing before upload is always better, because fewer bytes always help the user.
- Re-encoding a professional's photos loses nothing anyone would notice.
- Transcoding on the phone costs nothing, because the processor is idle during uploads.
- A transfer handed to the OS can read the compressed bytes from the app's memory.