How to force flutter `camera` plugin to take photo in portrait mode?

2,569

For those who're struggling with this problem, checking your device orientation when taking photos and its resulting exif data should help. Try these libraries:

native_device_orientation

exif

flutter_exif_rotation

Share:
2,569
Willy
Author by

Willy

Developer

Updated on December 09, 2022

Comments

  • Willy
    Willy over 1 year

    Is there a general way to do this?

    To add more context, it seems the camera plugin takes into account the device orientation when capturing image from the camera. Can we control it so that no matter what the orientation is, the result is still the same?

    plugin: camera 0.4.0+3

  • Elia Weiss
    Elia Weiss over 4 years
    Please elaborate
  • Willy
    Willy over 4 years
    Image files captured by most modern devices have EXIF data embedded, which is a set of metadata like orientation/rotation. Image viewers may or may not take this data into account when showing the image. More info.