save image taken by camera

Hi,
I am a newbie to this sdk.just started my learning.Excuse if question sounds absurd.
I want to take an image using Tablet camera and save it in the tablet.I am using media.show(media.Camera,listener,filePath) to take image and trying to save it.But this is not getting saved by the name i give. It is getting saved with the tablet’s current time(eg:20120907_101245.jpg).Now,how can i save image by the name i give. This is the code.Do i have to use media.save()???if so, how can i use it along with media.show???
Any help would be appreciated.

local sessionComplete = function(event)
local image = event.target
print( "Camera ", ( image and “returned an image” ) or “session was cancelled” )
print( "event name: " … event.name )
print( "target: " … tostring( image ) )

if image then
local w = image.width
local h = image.height
print( “w,h = “… w …”,” … h )
end
end
filePath = { baseDir = system.DocumentsDirectory, filename = “testing.jpg”,type = “image” }
local listener = function( event )
if media.hasSource( media.Camera ) then
media.show( media.Camera, sessionComplete,filePath)
else
native.showAlert(“Corona”, “Camera not found.”)
end
return true
end
bkgd:addEventListener( “tap”, listener ) [import]uid: 168398 topic_id: 30703 reply_id: 330703[/import]

Hello,

Did you get this working?
I’ve tried your code and I don’t find the photo on the Project Sandbox.

Thanks [import]uid: 189638 topic_id: 30703 reply_id: 132158[/import]

Hello,

Did you get this working?
I’ve tried your code and I don’t find the photo on the Project Sandbox.

Thanks [import]uid: 189638 topic_id: 30703 reply_id: 132158[/import]

In your sessionComplete function, insert your “image” variable into a display group.
Then save this group as an image using display.save

http://developer.coronalabs.com/reference/index/displaysave

local imageGroup = display.newGroup() local image = event.target imageGroup:insert(image) display.save( imageGroup, "mySavedPhoto.jpg", system.TemporaryDirectory )

This would save an image called “mySavedPhoto.jpg” in the Temp directory. [import]uid: 84115 topic_id: 30703 reply_id: 132317[/import]

In your sessionComplete function, insert your “image” variable into a display group.
Then save this group as an image using display.save

http://developer.coronalabs.com/reference/index/displaysave

local imageGroup = display.newGroup() local image = event.target imageGroup:insert(image) display.save( imageGroup, "mySavedPhoto.jpg", system.TemporaryDirectory )

This would save an image called “mySavedPhoto.jpg” in the Temp directory. [import]uid: 84115 topic_id: 30703 reply_id: 132317[/import]