Landscape vs. Portrait using ACL v.4.6

davelt99

Member
Licensed User
Longtime User
I'm using the ACl library version 4.6. From within the Camera1_Ready area, before Camera1.StartPreview, I'm setting the phone.SetScreenOrientation(1) and camera1.OriPortrait()

After taking the pictures, the app is uploading the picture(s) to a server.

I'm not setting camera1.PictureSize as that continues to generate errors.

However, the pictures still appear sideways at 90 degrees counterclockwise.

What do I need to do to have the pictures appear in portrait mode.

Any help would be greatly appreciated.

Thank you,

Dave Tucker
 

davelt99

Member
Licensed User
Longtime User
Thanks for the suggestion

I tried camera1.rotatebitmap2(Data,90) where I assumed that the Data would be the same Data being received by Camera1.PictureTaken(Data() as Byte)

but that doesn't work and seems to bypass the whole saving process, closing the app.

I'm confused as to what the Bmp would be in the camera1.rotatebitmap(Bmp,90)


Thanks much in advance,

Dave Tucker
 
Upvote 0

Jack Cole

Well-Known Member
Licensed User
Longtime User
I've never been able to rotate a full res image taken with ACL. On my device, Droid X2, the camera is 8 mp. It causes a force close because of being out of memory with a full res pic. I am able to downsize the image to 1500x1500 (max) and then rotate the image.

Although not completely ideal, you can do the rotation with modifying the EXIF tag. Here is some code I use to accomplish this from pics taken in portrait mode. You have to use the JPEGUTILS library.

NOTE: This will rotate the pictures if shown in the photo gallery, but not if shown in a B4A imageview control.

B4X:
Sub rotate_exif(dir As String,fn As String)

   Dim ex As ExifData
   
   If File.Exists(dir,fn) Then
      ex.Initialize(dir,fn)
      
      ex.setAttribute("Orientation",ex.ORIENTATION_ROTATE_90)
      ex.saveAttributes
   End If      
End Sub
 
Last edited:
Upvote 0
Top