Flutter camera image always portrait

Viewed 90

flutter, how to return a photo taken by the camera.

I wish that no matter the orientation of the camera, that the image taken is just in portrait.

-1) the log of the height and width does not change even when turning the camera.

-2) the approach of

if (exifData['Image Orientation'].printable.contains(' 180')) {

       img.Image fixed = img.copyRotate(original!, -180);
       File(originalPath).writeAsBytesSync(img.encodeJpg(fixed));

} 

does not always work.

-3) the approach of the package flutter_exif_rotation did not work.

-4) the method of the image img.bakeOrientation works but not always.

0 Answers
Related