image_gallery_saver icon indicating copy to clipboard operation
image_gallery_saver copied to clipboard

Image saves in a horizontal orientation

Open avatarKaran opened this issue 3 years ago • 1 comments

is this just an error with my phone --- (one plus 7)? all images are saving rotated

avatarKaran avatar Feb 02 '22 04:02 avatarKaran

Hello @avatarKaran this is a common issue on Android, you can try this: https://stackoverflow.com/questions/60176001/how-to-fix-wrong-rotation-of-photo-from-camera-in-flutter

import 'package:image/image.dart' as img;

...

final img.Image capturedImage = img.decodeImage(await File(path).readAsBytes());
final img.Image orientedImage = img.bakeOrientation(capturedImage);
await File(path).writeAsBytes(img.encodeJpg(orientedImage));

juanagu avatar Feb 15 '22 07:02 juanagu

Hello @avatarKaran this is a common issue on Android, you can try this: https://stackoverflow.com/questions/60176001/how-to-fix-wrong-rotation-of-photo-from-camera-in-flutter

import 'package:image/image.dart' as img;

...

final img.Image capturedImage = img.decodeImage(await File(path).readAsBytes());
final img.Image orientedImage = img.bakeOrientation(capturedImage);
await File(path).writeAsBytes(img.encodeJpg(orientedImage));

How to work this out if you already used ImageGallerySaver.saveImage ?

roderikpeeters avatar Aug 27 '23 07:08 roderikpeeters