(iOS) SkiaCamera canvas is unexpectedly rotated
Prerequisites
- I have read and followed every applicable step in the Nitro Modules Troubleshooting guide.
- I have read the VisionCamera Troubleshooting guide.
- I have searched existing issues and found nothing matching.
- I am on the latest version of react-native-vision-camera, or have a specific reason I cannot upgrade.
Reproduction
https://github.com/matthew8sweeney/SkiaCamera-test-app
Steps to reproduce
- Clone https://github.com/matthew8sweeney/SkiaCamera-test-app
- Follow the steps in the README to run the app on iOS.
- Rotate the screen orientation to anything other than upright portrait.
- Initially, the SkiaCamera component will not be rendered. Press the "Toggle SkiaCamera" button to mount the SkiaCamera. On this very first mount, the rotation of the canvas displays as expected.
- Press the "Toggle SkiaCamera" button to unmount the SkiaCamera.
- Press the "Toggle SkiaCamera" button to mount the SkiaCamera for the 2nd time. This time and all subsequent times, the canvas is rotated.
What did you expect to happen?
Unmounting and re-mounting a SkiaCamera component should not change the rotation of its canvas.
What actually happened?
Unmounting and re-mounting a SkiaCamera component may change the rotation of its canvas.
Affected platforms
iOS (device)
Device(s) affected
iPhone 12 (iOS 26.5.2), iPad Pro (11-inch) (3rd generation) (iPadOS 26.5.2)
VisionCamera version
5.2.2
React Native version
0.86.2
React Native architecture
New Architecture (Fabric / bridgeless)
Features being used
- Preview
- Photo capture
- Video capture
- Frame Processors (worklets)
- Skia Frame Processors
- Code/Barcode Scanner
- Location metadata
- Multi-cam
- Depth data
- HDR / custom dynamic range
- Custom format / FPS / resolution
Relevant logs / stack trace
N/AAdditional context
Here's an example of what I expect the SkiaCamera to show in landscape orientation with the top of the device to the left:
Here's what it looks like when this issue occurs:
Over all the times I've ever inspected the Frame.orientation property, I've noticed it has the value "left" when the screen orientation is upright portrait, and the other three values correspond to the other three screen orientations. I'm not sure whether that's always supposed to be the case, but I noticed that when this issue happens it has a value of "left" even though I expected a different value due to having a different screen orientation.
Submission
- The reproduction I linked is either (preferred) a PR against this repo that adds a failing harness test following the harness-tests README, or (fallback) a public repo that reproduces the bug on a fresh clone. I understand the issue will be closed without one.
- I pasted logs as text (not screenshots).
- I wrote this report in my own words. I did not paste AI-generated descriptions of the bug.
Source: mrousavy/react-native-vision-camera