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
camera: CameraPreview displays landscape images on an mobile web when it is held in a portrait position. #143288
Comments
Reproducible using the plugin example app (and site hosted above). This is not specific to iOS as I see a similar behavior on android (chrome). This might be related to how the Widget _wrapInRotatedBox({required Widget child}) {
if (kIsWeb || defaultTargetPlatform != TargetPlatform.android) {
return child;
}
return RotatedBox(
quarterTurns: _getQuarterTurns(),
child: child,
);
} Labeling for further insight from the team. flutter doctor -v
|
@wjkoh, @danagbemava-nc do you think this might be a duplicate of #112280 ? |
I don't think so because the behavior changes depending on the device orientation, not the window is full size or not. |
@wjkoh: Can you see if this version is better: https://zliide.github.io/camera-web-mobile-orientation/ |
Yes, your version works perfectly on my phone. Thanks for the fix! |
Steps to reproduce
The following steps were replicated on Flutter Web, iPhone 15, iOS 17.2.1, and Mobile Safari.
Expected results
It is expected that CameraPreview would display portrait images, similar to the iOS camera app.
Actual results
However, CameraPreview currently shows cropped landscape images instead.
Interestingly, when accessing the website with the phone already in a landscape position, the camera preview functions correctly. It even displays valid portrait images when the phone is rotated to a portrait position.
Code sample
Code sample
The official camera example from https://github.com/flutter/packages/tree/main/packages/camera/camera/example was used for the website without any modifications.
Screenshots or Video
Screenshots / Video demonstration
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: