Android Question Problems with image rotation of the Camera2 library

Matteo Granatiero

Active Member
Licensed User
What have you tried? Did you understand why this problem happens?
I solved with
B4X:
Dim bmp As Bitmap
    Dim rbmp As RSImageProcessing
    Dim casa As String
    Dim exif As ExifData
  
    rbmp.Initialize
    bmp.Initialize(FP, "1.jpg")
    exif.Initialize(FP, "1.jpg")
    casa =  exif.getAttribute(exif.TAG_ORIENTATION)
    If casa = 6 Then
    exif.setAttribute(exif.TAG_ORIENTATION, 1)
    exif.saveAttributes
    If bmp.width>bmp.height Then     
    bmp = rbmp.Rotate(bmp, 90)
    rbmp.writeBitmapToFile(bmp,FP ,"1.jpg", 100 )
    End If
    End If

Here :https://www.b4x.com/android/forum/threads/image-rotation-problem-with-native-camera.41522/
 
Upvote 0
Top