react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

Referencing Android issue 3027 related to Camera loosing sideProps like Zoom.

Open ShivamKJJW opened this issue 7 months ago • 5 comments

Issue: 3027 When camera is set to be active the side props needs to be reapplied as it is a known bug where zoom level gets resets on CameraX module after camera is set to inactive.

https://github.com/mrousavy/react-native-vision-camera/issues/3027

What

Android: Camera sideProps reflection on initialization and active state change

Changes

This PR adds a patch to re configure the side props whenver camera active state changes

Tested on

  • Redmi 12, Android 14
  • Redmi Pad Pro, Android 14
  • Samsung M53, Android 13

Related issues

Fixes #3027

ShivamKJJW avatar May 15 '25 11:05 ShivamKJJW

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 11:02am

vercel[bot] avatar May 15 '25 11:05 vercel[bot]

I confirm that the zoom bug mentionned in https://github.com/mrousavy/react-native-vision-camera/issues/3027 is fixed with this PR. It also fixed a similar issue with exposure.

Thanks a lot @ShivamKJJW 🙏🏻

RenaudAubert avatar May 15 '25 12:05 RenaudAubert

Does this only affect zoom? Isn't this a CameraX bug then?

mrousavy avatar Jun 16 '25 17:06 mrousavy

I appreciate the PR, but I don't want to monkey-patch broken behaviour in CameraX - this will lead to an unmaintainable mess.

We should rather file a bug report in CameraX and wait for a fix there.

mrousavy avatar Jun 16 '25 17:06 mrousavy

I appreciate the PR, but I don't want to monkey-patch broken behaviour in CameraX - this will lead to an unmaintainable mess.

We should rather file a bug report in CameraX and wait for a fix there.

I am not sure either that it is a bug from CameraX module itself. It seems that whenever camera state changes, the extra props needs to be set again if a custom behaviour is needed. By default camera initialises with the default zoom level of the device. Seems to be default android behaviour.

ShivamKJJW avatar Jun 17 '25 06:06 ShivamKJJW