0

There are a 1000 answers on Stack Overflow, but all of them use a matrix transformation and looking at the code a WxH image is created which has the dimensions of the original WxH. Just two examples: Portrait to Landscape image rotation and Controlling the camera to take pictures in portrait doesn't rotate the final images Some solutions even resize and scale to compensate.

I may misunderstand something, but what I need is a simple rotation. So say I have a 256 x 144 image (landscape, Media.Image or Bitmap) and I need to have another one which is 144 x 256 portrait, with the same content but rotated. I'd want to display the resulting Bitmap in an Android ImageView widget, so I suspect (but I'm not 100% sure) that simple meta-data manipulation (like JPEG EXIF rotation info, but for Bitmaps if such exists) might be out of the question, although that would be an efficient way.

How to do that, preferably in an efficient manner?

Csaba Toth
  • 10,021
  • 5
  • 75
  • 121
  • Looks like this https://stackoverflow.com/questions/8608734/android-rotate-bitmap-90-degrees-results-in-squashed-image-need-a-true-rotate-b might be similar, but every code does W x H -> W x H which is NOT landscape -> portrait. – Csaba Toth Jan 24 '23 at 22:41

0 Answers0