Android Question Rotate Photo Orientation S3

Douglas Farias

Expert
Licensed User
Longtime User
Hi!

How can i correct rotate the pictures on my galaxy s3?
the problem is the exif.TAG_ORIENTATION, on galaxy s3 is ever = 6
exif.TAG_ORIENTATION = 6 on S3

i dont know why, and how can i rotate the picture taked in landscape?

i m using this for portrait
B4X:
    exif.Initialize(fp, "tiradacamera.jpg")
    Log(exif.getAttribute(exif.TAG_ORIENTATION)&"exif")
    If exif.getAttribute(exif.TAG_ORIENTATION) = 6 Then
    Log("passo no 6")
    exif.setAttribute(exif.TAG_ORIENTATION, 1)
    exif.saveAttributes
    Dim rbmp As RSImageProcessing
    rbmp.Initialize
    puxabitmap = rbmp.rotateBitmap(puxabitmap, 90)
    End If

and is working, but to landscape i dont know when is left or right, the exif.TAG_ORIENTATION = 6 ever i dont know really what i make to fix this bug on S3
 

Douglas Farias

Expert
Licensed User
Longtime User
i dont understand this @Erel , how to know when i need rotate or no the photo on s3?

i m using this
exif.Initialize(fp, "tiradacamera.jpg")
exif.setAttribute(exif.TAG_ORIENTATION, exif.ORIENTATION_ROTATE_90)

later the photo is taked but this dont rotate the photo , and i cant rotate this via code, bacause the user can take photos on landscape too
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
this is the problem
Msgbox(exif.getAttribute(exif.TAG_ORIENTATION),"teste")
this is = 6 on galaxy s3 and another galaxy (samsung devices)

i can take photos in horizontal or vertical and the result is 6 ever only 6
how i can rotate the image if i dont know the correct current rotation?

look this image



i have take a picture in vertical, i get rotated photo
the Msgbox(exif.getAttribute(exif.TAG_ORIENTATION),"teste") of this photo is = 6

if i take on horizontal i get another rotation etc.

i m crazy man, how to make this correct?

can u show a sample pls how to take photos, if have not correct orientation set the correct?

i m really dont understand this bug on s3 device


for example, i made now if Msgbox(exif.getAttribute(exif.TAG_ORIENTATION),"teste") = 6 then rotate 90° and this works, but if i take a photo on horizontal (landscape) i get rotated photo again ¬¬
 

Attachments

  • upload_2014-11-18_14-5-9.png
    404.5 KB · Views: 342
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
@Erel, can u test this sample i made pls?
you have a galaxy s3? with this sample u go have the rotated photos and the msgbox with the orientation correct.
can u help me using this sample? is camex example with changes.

thx

i m making a video to explain the problem
 

Attachments

  • Camera.zip
    454 KB · Views: 380
Last edited:
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
the video is normal now can u see pls? i made this video only to show what i dont know to explain
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
yes this is a good solution, but have a way to know when i take a photo with phone on horizontal(landscape)?
but note: i m not using #SupportedOrientations: landscape, i m using portrait, my app is portrait.
i need only a camera to take photos and give me corretect rotation. have a way to know when i take photos on horizontal and dont need change my app to #SupportedOrientations: landscape?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…