can't get display.save() to work in my project

Fixed it remember to specify the correct directory when you load it back in

eg

baseDir = system.DocumentsDirectory
display.save( display.currentStage, “pirates.jpg”, baseDir )

temp = display.newImage(“pirates.jpg”,baseDir)

I didn’t include the baseDir in the last line! only a whole day wasted
[import]uid: 137150 topic_id: 25132 reply_id: 325132[/import]

Wow. That’s pretty lame with no clues or hints to let you know you blew it somewhere. Well, thanks for posting the solution for the rest of us! Sorry you had to waste a day!! :frowning: [import]uid: 11636 topic_id: 25132 reply_id: 102138[/import]

As mroberti said, thank you for updating and reminding everyone the importance of specifying the directory :slight_smile:

Also sorry to hear about the time spent on it. [import]uid: 52491 topic_id: 25132 reply_id: 102234[/import]

OK well I did post a more lengthy question, then I edited back after I had found the bug.

The actual issue was due to adding an image into an email. I had email with a link working, so all I needed to do was to save the image as a file which I has also had working too.

There my problems started as I merged the save image and send email functions. I had declared

local baseDir = system.DocuementsDirectory for the image save

BUT I think this clashed with the baseDir contained in the mailOptions table contained in the function

local mailOptions ={ to = nil,
cc = nil,
bcc = nil,
subject = “your subject”,
body = “your message”,
attachment = {baseDir = system.DocuementsDirectory, filename = “test.jg”, type =“image” },
isBodtHtml = false,
listener = onSentEmailMine
}

Any I fixed it by using a different name for the image save…

You did ask for more details :slight_smile:
[import]uid: 137150 topic_id: 25132 reply_id: 102531[/import]