Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Save and load picture after display.save
Started by bbk Oct 30 2017 09:04 AM

2 replies to this topic
display.save picture sqlite3
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

bbk

[GLOBAL: userInfoPane.html]
bbk
  • Enthusiast

  • 61 posts
  • Corona SDK

I have a problem saving and then displaying a captured picture. It works on my Simulator and iPhone, but not on the iPad - even though the picture captured by the camera is shown on the screen. (so it should not be a problem with the build.settings)

 

It may be a question for support, but I try to get advice here first....

 

 

I am capturing a picture and saving it to the system.DocumentsDirectory with the following code:

     -- Capture the screen and save it to file.      
      local photo = event.target
       
      local saveOption = 
      { 
        filename=theUniqueIDForPicture..".jpg", 
        baseDir=system.DocumentsDirectory, 
        captureOffscreenArea=true,
        backgroundColor={0,0,0,0} 
      } 


      display.save( photo, saveOption ) 

(I had tried earlier without the captureOffScreenArea = true, and then I only got part of the picture)

 

 

I then store the name of the picture in the database and retrieve it later with the following code:

local baseDir = system.DocumentsDirectory    
local pictureSavedAs = row.pathOfPicture
local image = display.newImage(thePicturesDisplayed, pictureSavedAs, baseDir )

This code works fine on the Simulator and on my iPhone 6 (iOS 11.0.3), but on the iPad the saved picture is only shown as a black square.

 

The picture that was captured from the camera. (local photo = event.target) can and is shown on the screen.

 

The code that I am using is mostly from the Sample Code/Media/Camera and I am using Corona Version 2017.3157 

 

I am attaching the code that I am using if you would like to try it on your devices.

 

 

Attached Files



[TOPIC: post.html]
#2

bbk

[GLOBAL: userInfoPane.html]
bbk
  • Enthusiast

  • 61 posts
  • Corona SDK

Dear Moderator 

I am not sure if you want me to delete this post, now that it seems like I have found a solution....

 

I tested with iOS 11.1, which did not help

 

Then I downloaded Corona build 2017.3163 and the iPad is able to save and thereafter display the image.



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,801 posts
  • Enterprise

Please leave it in case someone has the same issue and can see your solution.

 

Rob




[topic_controls]
[/topic_controls]