I have tried to verify the path. Using system.pathForFile and io:open the file exists.
Here’s some of the code I’m using
[lua]
local librarySessionComplete = function(event)
photo = event.target
if photo then
if photo.width > photo.height then
photo:rotate( -90 ) – rotate for landscape
print( “Rotated” )
print("W: "…photo.width)
end
local xScale = display.contentWidth / photo.contentWidth
local yScale = display.contentHeight / photo.contentHeight
local scale = math.max( xScale, yScale ) * .75
photo:scale( scale, scale )
photo.x = display.contentCenterX
photo.y = display.contentCenterY
display.save( photo, “Photo1-”…tonumber(gatheredId)…".png", system.DocumentsDirectory )
local docuPath = “Photo1-”…tonumber(gatheredId)
local updatePhoto = “UPDATE user_entries SET photo=’”…docuPath…"’ WHERE id=’"…gatheredId…"’"
db:exec(updatePhoto)
end
local pulledPhoto1 = {}
photo1IntAdded = 1
for row in db:nrows(“SELECT id, photo FROM user_entries WHERE id=’”…gatheredId…"’") do
pulledPhoto1[photo1IntAdded] = row.photo
photo1IntAdded=photo1IntAdded+1
end
local picPath = system.pathForFile( tostring(pulledPhoto1[row.index])…".png", system.DocumentsDirectory)
local openPic = io.open(picPath, “r+”)
if openPic then
print("FILE FOUND AT: "…picPath)
--row.photo =
print(openPic:read("*a"))
else
print(picPath)
print(openPic)
print(“ERROR”)
end
photo1 = widget.newButton
{
left = 1180,
top = display.contentCenterY - 150,
width = 60,
height = 90,
defaultFile = system.pathForFile( tostring(pulledPhoto1[row.index])…".png", system.DocumentsDirectory),
onEvent = choosePhoto,
}
[/lua]
Does that code help figure out what I’m trying to do? Is what I’m trying to do even possible in Corona?