0

I've followed Androids tutorial on how to take a full-size picture. (https://developer.android.com/training/camera/photobasics#java - The part "Save the full-size photo")

The resulting image I get is however ALWAYS in landscape mode, also if I take in Portrait mode. Also no difference whether I use the front or back camera.

I've also tried many answers from this thread and the ones that work also only give a landscape image (e.g. the answer from Vicky).


I must have the image in portrait mode though, how can I achieve this?

mathematics-and-caffeine
  • 1,664
  • 2
  • 15
  • 19
  • "The resulting image I get is however ALWAYS in landscape mode, also if I take in Portrait mode" -- how are you determining if the image is landscape? Are you loading it in `ImageView` and looking at the result? If so, how are you loading the image into the `ImageView`? Or are you determining this by some other means? – CommonsWare Feb 25 '21 at 22:59
  • `Bitmap photo = BitmapFactory.decodeFile(currentPhotoPath); bigimage.setImageBitmap(photo);` So yes, by an ImageView. – mathematics-and-caffeine Feb 25 '21 at 23:01
  • 1
    Use an image-loading library, such as Glide, Picasso, or coil. Or, use `ExifInterface` to read the orientation tag, then rotate your image before displaying it (or rotate the `ImageView`, if you prefer). – CommonsWare Feb 25 '21 at 23:05
  • Try using this, https://stackoverflow.com/a/14066265/10752962, it worked for me well.. – Vivek Thummar Mar 26 '21 at 06:07

0 Answers0