Not sure if this is the best way as I don't use B4Xthingy very much but it seems to do what you want.
You need to add the JFX library and XUI library
Dim xu As XUI
Dim fx As JFX
Sub AppStart (Args() As String)
Dim bm As B4XBitmap = xu.LoadBitmap("c:/temp" , "hannah.jpg")
bm = bm.Rotate(90)
What does BM. Rotate (90) do?
Does BM. Rotate (x) execute only changes to the EXIF values of the orientation and is then updated in the image's EXIF data
or are new x/Y values calculated on the image pixels to rotate the image
or both of those processes?
I use ABMaterial to view the images and ABMaterial does not read the EXIF data for the orientation but only the geometry. This indicates that geomytry data is not changed with the bm.Rotate(x)?
Which is not logical as the EXIF information is lost!
Therefore, it makes no sense for me to change the EXIF data either!
Strange and confusing!
After further investigation, it has been found that if I convert the image to .bmp and rotate it in the photo program (GIMP2) and convert it back to .jpg so finally the image is displayed in the ABMaterial with the correct orientation. If I rotate it again with
then it is not rotated correctly in ABMaterial! However, I see in the icon in the folder and if I open it with foroprogrammet then it is rotated correct.
Bm.Rotate and the photo programs do not do the same rotation-procedure!
Seems impossible to solve the problem of this!