media.selectPhoto() issue

Hi All ,

got some issue with media.selectPhoto()  api  , it’s working fine on android devices 

and use to work on iOS …

local function setNewImage()

    log:log(“setNewImage”)

    mainHeadPicMan.alpha = 0

    mainHeadPicWoman.alpha = 0

    customImageCircle.fill = { type=“image”,  baseDir=system.DocumentsDirectory ,filename= settingsUtil.getPalyerSettingByKey(settingsUtil.SettingsTable.LastImageName)}

    customImageCircle.alpha = 1 

end

local function onCapturePhotoComplete(event)

    log:log(“onCapturePhotoComplete” ,event.completed)

    if event.completed == true then

        local oldImageFile = settingsUtil.getPalyerSettingByKey(settingsUtil.SettingsTable.LastImageName)

        if(oldImageFile ~= nil and oldImageFile ~= “”)then

            os.remove( system.pathForFile( oldImageFile, system.DocumentsDirectory ) )

        end

        

        settingsUtil.setPalyerSettingByKey(settingsUtil.SettingsTable.CustomImage, “true”)

        settingsUtil.setPalyerSettingByKey(settingsUtil.SettingsTable.LastImageName, newImageName)

        timer.performWithDelay(timerWaitTime, setNewImage, 1)

    end

    

end

local function photoLibraryImage(event)

    if(event.phase == “began” )then

        log:log(“cameraImage”)

        newImageName = “customImage_” … tostring(os.time ()) …".png"

        timer.performWithDelay( 150,  media.selectPhoto { listener = onCapturePhotoComplete ,mediaSource=media.PhotoLibrary  ,destination = { baseDir=system.DocumentsDirectory, filename=newImageName, type=“image” } } ) 

    end

end

but when i display the image from the saved file , the orientation is (-90) ??