Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Preview stretch in Android landscape mode,Incorrect orientation in IOS landscape mode. #2584

Closed
3 of 5 tasks
boiboif opened this issue Feb 19, 2024 · 1 comment
Closed
3 of 5 tasks
Labels
馃悰 bug Something isn't working

Comments

@boiboif
Copy link

boiboif commented Feb 19, 2024

What's happening?

Preview stretch in Android landscape mode, Normal in portrait mode.
image

Incorrect orientation in IOS landscape mode. No stretching issues.
image

Reproduceable Code

in AndroidManifest.xml
android:screenOrientation="landscape"

in Info.plist
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>


/****************/

const [hasPermission, setHasPermission] = React.useState(false);
const camera = React.useRef<Camera>(null);
const device = useCameraDevice('back');

 React.useEffect(() => {
    (async () => {
      const status = await Camera.requestCameraPermission();
      if (status === 'denied') {
        return navigation.goBack();
      }
      setHasPermission(status === 'granted');
    })();
  }, [navigation]);

return device != null && hasPermission ? 
 <Camera
    orientation="landscape-right"
    ref={camera}
    style={StyleSheet.absoluteFill}
    device={device}
    isActive={true}
    photo
/> : null

Relevant log output

-

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": true,
  "isMultiCam": false,
  "minFocusDistance": 10,
  "minExposure": -24,
  "name": "BACK (0)",
  "hasFlash": true,
  "hasTorch": true,
  "position": "back",
  "id": "0"
}

Device

Redmi k50

VisionCamera Version

3.9.0

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (鈿狅笍 your issue might get ignored & closed if you don't try this)

Additional information

@boiboif boiboif added the 馃悰 bug Something isn't working label Feb 19, 2024
@mrousavy
Copy link
Owner

As mentioned in the first pinned issue, Orientation is not yet supported and work in progress. #1891

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃悰 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants