Android Question Photo taken correctly, imageview shows it rotated


Active Member
Licensed User

I'm sure this has been asked before, but I haven't found an answer without using lots of rotation code.

I took a photo (640x480) using CameraEX and I'm getting weird results with the photo.

If I load it in DirectoryOpus or Photoshop the image loads ok (just as taken) but if I load it in Fireworks or B4A (ImageViews) it loads rotated.

This is an example:


I'm including the photo just as it was taken with the device.

Is there anyway to load it the way it's meant to be inside B4A?

Thanks a lot!


    40.6 KB · Views: 111


Active Member
Licensed User
I think I've found the difference... It's the EXIF data, if I clear EXIF the image will always load rotated (Now Photoshop and DOpus also load it like B4A).

Is there anyway ImageViews take EXIF data in consideration so it loads correctly?

Upvote 0


Active Member
Licensed User
Well... Now I have a related problem.

The photo loads inside ImageView ok, but I have to upload it to a website. The problem is when I download the photo it's rotated again. I used a WebService and the uploaded file still has Exif data.

First, I used (after httputils2):
Dim BMFoto As Bitmap
imgPhoto.Bitmap = BMFoto ' imgPhoto is my ImageView

This worked but the image is rotated. Since ExifData can only be initializated through a saved bitmap, I tried to save the bitmap contained in BMFoto:
Dim out As OutputStream
Dim dir As String = File.DirRootExternal
Dim fname As String = "rotate.jpg"
out = File.OpenOutput(dir,fname,False)

The problem is, the new file named "rotate.jpg" has lost all Exif data :(

Any idea how can I fix this?

Thanks again!
Upvote 0