mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.62k stars 1.1k forks source link

🐛 In landscape mode, enabling frameProcessor causes preview image stretching and incorrect orientation #3259

Open boiboif opened 1 month ago

boiboif commented 1 month ago

What's happening?

In landscape mode

Preview without frameProcessor: a7deb7116f13b4be0aa09ea572fd3981

Preview with frameProcessor enabled: d2835bcaa9e046cdc1b65f98853bae21

Reproduceable Code

const frameProcessor = useFrameProcessor(
    frame => {
      'worklet';
    },
    [handleDetectedFaces],
  );

<Camera
  ref={camera}
  style={StyleSheet.absoluteFill}
  device={device}
  isActive={true}
  photo
  // frameProcessor={frameProcessor}
/>

Relevant log output

> Configure project :react-native-vision-camera
[VisionCamera] Thank you for using VisionCamera ??
[VisionCamera] If you enjoy using VisionCamera, please consider sponsoring this project: https://github.com/sponsors/mrousavy
[VisionCamera] node_modules found at C:\Users\87332\Desktop\tc\healthybd-app\node_modules
[VisionCamera] VisionCamera_enableFrameProcessors is set to true!
[VisionCamera] react-native-worklets-core found, Frame Processors are enabled!
[VisionCamera] VisionCamera_enableCodeScanner is set to false!

Camera Device

{
  "formats": [],
  "sensorOrientation": "landscape-left",
  "hardwareLevel": "full",
  "maxZoom": 10,
  "minZoom": 1,
  "maxExposure": 24,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": false,
  "isMultiCam": false,
  "minFocusDistance": 10,
  "minExposure": -24,
  "name": "0 (BACK) androidx.camera.camera2",
  "hasFlash": true,
  "hasTorch": true,
  "position": "back",
  "id": "0"
}

Device

redmi k50

VisionCamera Version

4.5.3

Can you reproduce this issue in the VisionCamera Example app?

No, I cannot reproduce the issue in the Example app

Additional information

maintenance-hans[bot] commented 1 month ago

Guten Tag, Hans here! 🍻

I see you have provided some information about ze issue, but to help mrousavy resolve it effectively, we need to gather more logs. Please provide logs from adb logcat while reproducing ze issue, as they can help diagnose what’s happening during runtime.

Also, it might be worth considering sponsoring ze project if you’d like more immediate attention on this issue: Sponsor mrousavy.

Let’s make sure ze issue is clear so we can get to ze bottom of it together!

Note: If you think I made a mistake, please ping @mrousavy to take a look.