Mobile: live camera viewfinder squished/stretched (Android)
Describe the bug On Android (reported on GrapheneOS), the live camera viewfinder in the mobile composer's in-app camera is visibly squished/stretched while framing a shot. The captured photo itself is unaffected — only the live preview.
Steps to reproduce
- On Buzz mobile (Android), open a channel.
- Tap the composer's attachment button → Camera.
- Watch the live viewfinder before tapping the shutter.
Expected behavior The viewfinder should render at the camera's native aspect ratio without stretching or squishing.
Version and platform
- Buzz version: 0.5.14 (mobile)
- OS: Android, GrapheneOS
Logs / additional context
mobile/lib/features/channels/compose_bar/camera_preview.dart (_CameraFeed, ~lines 170-190):
final previewSize = controller.value.previewSize;
...
SizedBox(width: previewSize.height, height: previewSize.width, child: camera.CameraPreview(controller))
This hardcodes a width/height swap on CameraController.value.previewSize instead of checking CameraDescription.sensorOrientation. It assumes the sensor is always exactly 90° off from the UI orientation, which doesn't hold universally across devices/cameras.
GrapheneOS routes camera access through its own permission-sandboxed camera layer, which may report previewSize/camera characteristics differently than stock Android — worth checking whether that's what makes this visible here specifically (vs. stock Android where the assumption may happen to hold more often).
No existing issue found for this (searched "camera preview," "viewfinder," "distorted," "squished/stretched," "aspect ratio," "rotated," "sideways").
Hi maintainers,
I'm interested in contributing a fix for #8492.
The reported viewfinder distortion appears related to how camera preview dimensions and orientation are handled on Android.
I'd like to verify the behavior against the latest code, add a focused regression test for differing sensor and display orientations, and implement a minimal correction that preserves the captured-image behavior.
I've checked for matching pull requests and haven't found an existing implementation so far.
Please let me know if there are any device-specific constraints or preferred approaches.
Thank you!