-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 In landscape mode, enabling frameProcessor causes preview image stretching and incorrect orientation #3259
Comments
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 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!
|
I'm having the same issue on 4.5.2 on OnePlus5. In my case, when the phone is in portrait mode, the preview shows correct. If I rotate the phone to landscape, I get the incorrect orientation and stretching. Were you able to fix it? |
My application is a landscape-oriented app. Currently, my solution is to force the camera screen to portrait orientation. const portraitHoc = (Component: React.ComponentType<any>) => {
return (props: any) => {
const [hasLocked, setHasLocked] = React.useState(false);
const previousOri = React.useRef<OrientationType>();
React.useEffect(() => {
let timer: NodeJS.Timeout;
locker.getOrientation(o => {
previousOri.current = o;
locker.lockToPortrait();
timer = setInterval(() => {
locker.getOrientation(o => {
if (o === OrientationType.PORTRAIT) {
setHasLocked(true);
clearInterval(timer);
}
});
}, 100);
});
return () => {
clearInterval(timer);
if (previousOri.current === OrientationType['LANDSCAPE-RIGHT']) {
locker.lockToLandscapeRight();
} else if (previousOri.current === OrientationType['LANDSCAPE-LEFT']) {
locker.lockToLandscapeLeft();
} else {
locker.lockToLandscape();
}
};
}, []);
return hasLocked ? <Component {...props} /> : null;
};
};
export default portraitHoc(Facedetect); |
This problem can be reproduced using the example app. Related to #3051 (comment) |
What's happening?
In landscape mode
Preview without frameProcessor:
Preview with frameProcessor enabled:
Reproduceable Code
Relevant log output
Camera Device
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
The text was updated successfully, but these errors were encountered: