Hello, i am trying to save a photo from android photo library to the system.DocumentsDirectory but i have a problem. Although i get succesfuly the pic from the library, the pic is not in it’s real resolution. Actualy the pic is cutted. I believe this has to do with display.save() function that i use. How can i save the photo without to be cutted or scaled? Any help would be appreciated!
this is my code:
local function sessionComplete ( event ) t = event.target local baseDir = system.DocumentsDirectory display.save(t, "photo.jpg", baseDir) t.x = \_W/2 t.y = \_H/2 t.xScale = .25 t.yScale = .25 local options = { to = { "email@email.com" }, subject = "My High Score", isBodyHtml = true, body = "\<html\>\<body\>I scored over \<b\>9000\</b\>!!! Can you do better?\</body\>\</html\>", attachment = { { baseDir=system.DocumentsDirectory, filename="photo.jpg", type="image" }, }, } native.showPopup("mail", options) end local UploadBar = display.newImageRect("m1.png",144,60); UploadBar:setReferencePoint(display.TopLeftReferencePoint) UploadBar.x=0; UploadBar.y=0; local function newphoto ( event ) if (event.phase == "began") then media.show( media.PhotoLibrary, sessionComplete ) return true end end UploadBar:addEventListener("touch", newphoto)