buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Mobile: live camera viewfinder squished/stretched (Android)

Open astromara opened this issue 1 month ago • 1 comments

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

  1. On Buzz mobile (Android), open a channel.
  2. Tap the composer's attachment button → Camera.
  3. 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").

astromara avatar Oct 20 '26 19:10 astromara

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!

sunny-kavixo avatar Oct 20 '26 19:10 sunny-kavixo