Sub chooser_Result (Success As Boolean, Dir As String, FileName As String)
If Success Then
Dim bmp As Bitmap
bmp.Initialize(Dir, FileName)
imgFoto.Bitmap = bmp
End If
.
.
.
The image in the chooser is shown right, no matter if the picture was taken portrait or landscape or if it is a screenshot.
I've tried using the ExifData library, but orientation returns always 0:
B4X:
Dim exif As ExifData
Dim sOrientation As String
exif.Initialize(Dir, FileName)
sOrientation = exif.getAttribute(exif.TAG_ORIENTATION)
I've checked here and here; It's correct to assume that if the orientation is 0, the picture has no orientation registered?
Try to copy the image to a temporary file (File.Copy2 and don't forget to close the OutputStream) and see whether exif returns the correct orientation of the newly created file.
The real problem here is that the exif.getAttribute returns 0 instead of throwing an error when it fails to read the attributes. It fails to read them because it cannot handle the dir passed which is not a real file system path.