My app uses the devices camera to take photos. However, when I do this, any photos I take are saved in the device’s gallery. How can I stop this from happening?
Can you post the code you’re using to take the photo?
Rob
[lua]
local sessionComplete = function(event, picName)
local pictureThere = event.completed
if pictureThere == true then – If there was an image returned, then the send button is displayed.
addToQueue(picName)
takePicButton:toFront( )
takePicText:toFront()
else
takePicButton.isVisible = true
takePicText.isVisible = true
end
end
if media.hasSource( media.Camera ) then
crashReporter.setTakingPic(true)
media.capturePhoto( {
listener = callQueueSave,
destination = {
baseDir = system.DocumentsDirectory,
filename = picName,
type = “image”
}
} )
takePicButton.isVisible = false
takePicText.isVisible = false
else
native.showAlert(“Alert”, “Camera not found.”)
end[/lua]
I don’t know of a way of preventing that.
Rob
I don’t know how much this will help, but Engineering has confirmed that we have a built-in camera activity that will bypass the external camera activity that Corona uses by default. We have no control over what the camera app does and how it behaves which is why this is a problem.
You can force Corona to use our internal activity which won’t save to the gallery, but it’s going to stretch the image to fit the screen. It may work for you it may not.
To force our activity to be used, remove the WRITE_EXTERNAL_STORAGE permission but keep the CAMERA permission.
There is a good chance you won’t like this result either, but at least it won’t write to the Gallery.
Rob
Can you post the code you’re using to take the photo?
Rob
[lua]
local sessionComplete = function(event, picName)
local pictureThere = event.completed
if pictureThere == true then – If there was an image returned, then the send button is displayed.
addToQueue(picName)
takePicButton:toFront( )
takePicText:toFront()
else
takePicButton.isVisible = true
takePicText.isVisible = true
end
end
if media.hasSource( media.Camera ) then
crashReporter.setTakingPic(true)
media.capturePhoto( {
listener = callQueueSave,
destination = {
baseDir = system.DocumentsDirectory,
filename = picName,
type = “image”
}
} )
takePicButton.isVisible = false
takePicText.isVisible = false
else
native.showAlert(“Alert”, “Camera not found.”)
end[/lua]
I don’t know of a way of preventing that.
Rob
I don’t know how much this will help, but Engineering has confirmed that we have a built-in camera activity that will bypass the external camera activity that Corona uses by default. We have no control over what the camera app does and how it behaves which is why this is a problem.
You can force Corona to use our internal activity which won’t save to the gallery, but it’s going to stretch the image to fit the screen. It may work for you it may not.
To force our activity to be used, remove the WRITE_EXTERNAL_STORAGE permission but keep the CAMERA permission.
There is a good chance you won’t like this result either, but at least it won’t write to the Gallery.
Rob