Hi,
I’m new at this so apologies for what is a probably an easy fix. I searched at length but couldn’t find a similar issue being reported.
On both media.selectPhoto and media.capturePhoto, I’m experiencing an issue right after the photo is selected or captured (after tapping “Use Photo”). Rather than immediately returning to the app, the native photo capture/select screen is transitioning in from the bottom of the screen. I see the app for a small fraction of a second when the photo capture/select screen is “re” transitioning back into view. Momentarily you think it didn’t register your selection and then it returns to the app.
This doesn’t occur on the simulator, only on the device.
Details:
Corona SDK Build 2014.2393
Device - iPhone 5S (iOS 7.1.2)
Code:
function onComplete (event) if ( event.completed ) then -- ... does a few things to scale and reposition the image end photo1New:addEventListener( "tap", menu.takePhoto1) photo1CameraRoll:addEventListener( "tap", menu.pickPhoto1) --selectPhoto (kept in a separate module) function T.pickPhoto1(event) if media.hasSource( media.PhotoLibrary ) then tempData.img1 = tempData.submissionID .."-img1.jpg" media.selectPhoto( { mediaSource = media.PhotoLibrary, listener = onComplete, destination = { baseDir = system.TemporaryDirectory, filename = tempData.img1, --tempData.submissionID .. type = "image"} } ) else native.showAlert( "Corona", "This device does not have a photo library.", { "OK" } ) end end --capturePhoto (kept in a separate module, same module where I keep the selectPhoto) function T.takePhoto1(event) tempData.img1 = tempData.submissionID .. "-img1.jpg" if media.hasSource( media.Camera ) then media.capturePhoto( { listener = onComplete, destination = { baseDir = system.TemporaryDirectory, filename = tempData.img1, type = "image"} } ) else native.showAlert("Corona", "Camera not found.") end end
Information from Xcode console at the time of events (capturing a photo):
Aug 31 18:41:20 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 1
Aug 31 18:41:20 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::power_on_hardware
Aug 31 18:41:20 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::ISP_SelectBestMIPIFrequencyIndex_gated - channel: 0, index: 1
Aug 31 18:41:34 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 0
Aug 31 18:41:34 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::power_off_hardware
Thanks in advance for the help.
Cheers,
Jeremiah