Closed frenberg closed 2 months ago
The recent Vision Camera version added support for orientation: https://github.com/mrousavy/react-native-vision-camera/pull/2932#issuecomment-2154196434
I have to rotate the camera frame to match the preview. It is tested using vision camera v4.3.2.
Thanks for the quick response.
Appologies, I thought I posted my versions but yeah I'm running vision-camera v4.3.2 too.
I can't see where you rotate the camera frame in the example app? Can you please send a link or what am I missing 🙈
Well, it is done in the plugin's native code. You'd better lock the orientation and try again.
Aha, so it is handled in the native code and I should not have to change the frameprocessor or style?
Yes. You need to change the js code since the frame width and frame height for iOS are different now.
before it was "if Platform.Android" but now it checks frame width and frameheight instead...
Right. My previous version checks the platform. Now we have to deal with the orientation problem for both platforms.
I did notice this and I have made the same change I think 🤔 But if this works I must have messed up something 🙈
You can skip the calculation of frame width and frame height first since we've set a fixed resolution: 1920x1080. Then the frame width should be 1080 and the frame height should be 1920.
okey... this is working for me
} else if frame.orientation == UIImage.Orientation.up {
degree = 90.0;
Hi!
Was just updating to the latest version and have run into an issue on iOS.
it looks like the coordinates for the results are (not?) rotated, tested this on iphone 12 and 15 pro and ios 17.5 and 18 beta. Works good like before on android.