realtebo
realtebo

Reputation: 25691

flutter plugin camera take photo 90° rotated; can we force rotate?

I am using camera plugin to take photo

body: FutureBuilder<void>(
  future: _initializeControllerFuture,
  builder: (context, snapshot) {
    if (snapshot.connectionState == ConnectionState.done) {
      // If the Future is complete, display the preview.
      return CameraPreview(_controller);
    } else {
      // Otherwise, display a loading indicator.
      return Center(child: CircularProgressIndicator());
    }
  },
)

I didn't modify settings

Similar problem with cordova plugin : https://github.com/apache/cordova-plugin-camera/issues/801

So It's a bug of the tablet I suppose.

Question: how to rotate picture using this plugin? For example, is there a rotation option? Or, can we add EXIF metadata to suggest image rotation when displaying?

Upvotes: 0

Views: 42

Answers (1)

Duy Tran
Duy Tran

Reputation: 1157

Some Android devices like Samsung will set the wrong exif orientation

Eg: you can use that device, take a portrait photo by the default camera, upload it to a website can read exif info, find the orientation field and see weird info like "90 CW" even the photo is portrait. Some photo apps ignore this info and show the truth, but some will rotate your photo depending on exif orientation value

Having some solutions to set the exif info again, and I'm using this package https://pub.dev/packages/flutter_exif_rotation, it works

Upvotes: 0

Related Questions