Hi guys, I have a problem with image orientation taking with CameraEx Class. Here are the problems : 1) on camera preview, image orientation is portrait 2) when picture taken and save to file with these codes Sub Camera_PictureTaken (Data() As Byte) Private filename As String = "1.jpg"...
www.b4x.com
Our app is completly portrait. However a user can take a picture in every modus, it's a phone so landscape or portrait are options.
Using the code below results in allways an portrait preview and imagefile. Even if the picture is taken landscape.
When checking the exif data from the picture, the result i allways 90. Wheter we're holding the phone landscape or portrait
B4X:
Dim retValue As Int = 0
Dim filepath As String
Dim exif As ExifData
filepath = dir & "/" & Filename
exif.Initialize("", filepath)
' // Get orientation
Dim w As Int = exif.getAttributeInt (exif.TAG_ORIENTATION, 0)
If w = exif.ORIENTATION_NORMAL Then retValue = 0
If w = exif.ORIENTATION_ROTATE_90 Then retValue = 90
If w = exif.ORIENTATION_ROTATE_180 Then retValue = 180
If w = exif.ORIENTATION_ROTATE_270 Then retValue = 270
Log(retValue)
Return retValue
Really need some help with this. Does the portrait mode has something to do with it?