Android Question Problem in Camera picture

devmobile

Active Member
Licensed User
Hello
When i select picture that taken with camera from Gallery,it return rotated picture
But in gallery is correct
This problem exist in samsung
 
Last edited:

devmobile

Active Member
Licensed User
I found solution finally
I use below code
But when i select second picture from gallery,it get error Caused by: java.lang.OutOfMemoryError
How can i solve it? (When i use LoadBitmapSample,it is working and dont get error,but i dont know that what is bitmap size)

B4X:
Private Sub cc_Result (Success As Boolean, Dir As String, FileName As String)
   
    If Success Then
   
        Dim ou As OutputStream
        ou = File.OpenOutput(File.DirInternal,"temp.jpg",False)
        File.Copy2(File.OpenInput(Dir,FileName),ou)
        ou.Close
       
        Dim temp As Bitmap
        temp = LoadBitmap(File.DirInternal,"temp.jpg")

        Dim exif As ExifData
        exif.Initialize(File.DirInternal,"temp.jpg")
           
        Select exif.getAttribute(exif.TAG_ORIENTATION)
            Case exif.ORIENTATION_ROTATE_180
                temp = RotateBitmap(temp,180)
           
            Case exif.ORIENTATION_ROTATE_270
                temp = RotateBitmap(temp,270)
           
            Case exif.ORIENTATION_ROTATE_90
                temp = RotateBitmap(temp,90)
               
        End Select
       
        CallSub2(modue,evt,temp)
       
    End If
   
End Sub
 
Upvote 0
Top