Skip to content

馃悰 (iOS) SkiaCamera canvas is unexpectedly rotated#4153

Description

@matthew8sweeney

Prerequisites

Reproduction

https://github.com/matthew8sweeney/SkiaCamera-test-app

Steps to reproduce

  1. Clone https://github.com/matthew8sweeney/SkiaCamera-test-app
  2. Follow the steps in the README to run the app on iOS.
  3. Rotate the screen orientation to anything other than upright portrait.
  4. 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.
  5. Press the "Toggle SkiaCamera" button to unmount the SkiaCamera.
  6. 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/A

Additional 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:
Image

Here's what it looks like when this issue occurs:
Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    馃悰 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions