Compress images and videos before upload - #6429
Conversation
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/30387637532/artifacts/8699821637 |
Adds an optional compression step to the chat attachment upload flow,
covering both gallery-picked and camera-captured photos/videos.
- Add ImageCompressor/VideoCompressor utilities: images are downscaled
and re-encoded as JPEG; videos are downscaled to 540p short side and
transcoded via Media3 Transformer on a dedicated HandlerThread so the
main thread is never blocked.
- Migrate the file attachment preview dialog to Jetpack Compose, adding
thumbnails, per-file dimensions/size preview, and a "Compress images
and videos" checkbox that updates the preview live.
- Persist the compression choice as a user preference (default on),
with a toggle in Settings.
- Extend the existing upload notification to also show live progress
("Compressing… X%") while a video is being transcoded, by polling
Transformer.getProgress(), before it turns into the upload progress
notification.
- Modernize BitmapShrinker to use ImageDecoder on API 28+ (single-pass
decode+scale, automatic EXIF rotation for JPEG/HEIC), falling back to
the previous BitmapFactory-based path on API 26/27.
- Fix MIME-type resolution for file:// URIs (e.g. camera-captured
photos/videos), which previously failed dialog/thumbnail detection
since ContentResolver.getType() only handles content:// URIs.
Assisted-by: Claude Code 2.1.199:claude-sonnet-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
cd7df8f to
c950080
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/30388822788/artifacts/8700239068 |
There was a problem hiding this comment.
It would be nice to formulate and design it a bit less technical. Signal e.g. specifically calls it "Sent media quality" with an easy to understand "Low" and "High" setting.
I'd say we could have a single-select segmented button in the send flow with:
- Original quality
- Reduced quality
And last selected setting remembered. What do you think @nimishavijay


Adds an optional compression step to the chat attachment upload flow, covering both gallery-picked and camera-captured photos/videos.
Assisted-by: Claude Code 2.1.199:claude-sonnet-5
🖼️ Screenshots
🚧 TODO
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)