Image auto-rotates when captured in portrait

Hi Everyone!

I use media.capturephoto( ) then save the captured photo into a file then stored to the DocumentsDirectory.  However, when I capture a photo in portrait mode, the image is automatically to rotated to landscape.  But whe I capture in landscape,it stays as is.  How do I prevent that?

—code snippets for capturing image

media.capturePhoto({ listener = onPhotoComplete,

  destination = {

            baseDir = system.DocumentsDirectory,

            filename = tempFName,  —some filename

            type = “image”

    }

})

–how I display

local card

card = display.newImage( _G.user.othercards[ndx].photo, system.DocumentsDirectory )

_G.anchor.Center(card)

card.x = _W * 0.5

card.y = logo.height + 100   — where logo is some image

any thoughts? 

Thanks!

I had a similar issue, where the image taken by the phone does not auto-rotate because you need to read the exif file to determine the rotation. I use php (on a server) to read the exif and auto rotate, then store the image on the server. 

If you are doing it on the phone, try to read the exif file. There is a field called ‘rotation’. All photos taken on mobile devices will have it.

Thank you so much.  I will have a look.  Will let you know.

I had a similar issue, where the image taken by the phone does not auto-rotate because you need to read the exif file to determine the rotation. I use php (on a server) to read the exif and auto rotate, then store the image on the server. 

If you are doing it on the phone, try to read the exif file. There is a field called ‘rotation’. All photos taken on mobile devices will have it.

Thank you so much.  I will have a look.  Will let you know.