Can't View Exported Image
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 5
- Joined: Thu Jun 29, 2017 1:00 pm
Can't View Exported Image
Hi,
I am trying to save images for the profile picture in sqllite database. I just move the images to the specific folder and save the image name in sqllite.But in android i could not find the image. Can you please help me
Thanks in advance.
Regards,
Anbu
I am trying to save images for the profile picture in sqllite database. I just move the images to the specific folder and save the image name in sqllite.But in android i could not find the image. Can you please help me
Thanks in advance.
Regards,
Anbu
Re: Can't View Exported Image
Hi Anbu,
welcome to the forum!
Please give us some more info and post the script your are using to store
the pathname and what pathname (specific folder?) do you save?
Best
Klaus
welcome to the forum!
Please give us some more info and post the script your are using to store
the pathname and what pathname (specific folder?) do you save?
Best
Klaus
-
- Posts: 5
- Joined: Thu Jun 29, 2017 1:00 pm
Re: Can't View Exported Image
Hi klaus,
This is my code. I could not find the image "Success.png" in my android mobile.
on mouseUp
set the lockloc of the templateimage to true
set the width of the templateimage to "322"
set the height of the templateimage to "255"
set the left of the templateimage to "30"
set the top of the templateimage to "181"
if the platform is "iphone" then
mobilePickPhoto "Album", 600,600
else
mobilePickPhoto "library" , 320,410
end if
put the last image into img "ViewImage"
export img "ViewImage" to file "success.png" as JPEG
end mouseUp
Regards,
Anbu
This is my code. I could not find the image "Success.png" in my android mobile.
on mouseUp
set the lockloc of the templateimage to true
set the width of the templateimage to "322"
set the height of the templateimage to "255"
set the left of the templateimage to "30"
set the top of the templateimage to "181"
if the platform is "iphone" then
mobilePickPhoto "Album", 600,600
else
mobilePickPhoto "library" , 320,410
end if
put the last image into img "ViewImage"
export img "ViewImage" to file "success.png" as JPEG
end mouseUp
Regards,
Anbu
Re: Can't View Exported Image
Hi anbu,
you are using a relative pathname here, but at that point "the defaultfolder" is probably some folder
inside of the application package where your app does NOT have write permission.
So the script silenty fails at this point. You can check this by adding something like:
If no error occurs, the result will be empty, otherwise it may give you a hint.
But that will not help you much in this situation, so better use something like this:
Best
Klaus
Code: Select all
...
export img "ViewImage" to file "success.png" as JPEG
...
inside of the application package where your app does NOT have write permission.
So the script silenty fails at this point. You can check this by adding something like:
Code: Select all
...
export img "ViewImage" to file "success.png" as JPEG
if the result <> EMPTY then
answer "Error:" && the result
end if
...
But that will not help you much in this situation, so better use something like this:
Code: Select all
...
## This is the only folder on the mobile platform (Android and iOS) where we have write permission AND we should use the correct file suffix! 8-)
put specialfolderpath("documents") & "/success.jpg" into tFile
## export img "ViewImage" to file "success.png" as JPEG
export img "ViewImage" to file tFile as JPEG
...
Klaus
-
- Posts: 5
- Joined: Thu Jun 29, 2017 1:00 pm
Re: Can't View Exported Image
Hi Klaus,
I get the result as empty but i cant view the image in documents folder in android.But in Windows i can see the image in documents.Can i get any suggesstion?
Regards,
Prabha.M
I get the result as empty but i cant view the image in documents folder in android.But in Windows i can see the image in documents.Can i get any suggesstion?
Regards,
Prabha.M
Re: Can't View Exported Image
How do you check this? With Livecode? If yes, how?Prabhavins wrote:I get the result as empty but i cant view the image in documents folder in android.
Hint: Really NO need to put numbers in quotes!
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: Can't View Exported Image
As it happens I'm currently working on something similar. I'm saving the pic as a .png but you can change it to .jpg
The specific folder the pic is getting save to (tPicFolder) is pulled from the Db. That's he first line.
The second line puts the full path into tFolderPath
The third line builds a unique name for the pic based upon the row ID in the Db (tCarID), which is pulled from the Db when tPicFolder is pulled.
The last line puts everything together and saves the pic. sTheNewImage is the ID of the image element (not the pic image) that has the pic I want to save. It's defined high in the script.
The specific folder the pic is getting save to (tPicFolder) is pulled from the Db. That's he first line.
The second line puts the full path into tFolderPath
The third line builds a unique name for the pic based upon the row ID in the Db (tCarID), which is pulled from the Db when tPicFolder is pulled.
The last line puts everything together and saves the pic. sTheNewImage is the ID of the image element (not the pic image) that has the pic I want to save. It's defined high in the script.
Code: Select all
put item 2 of tPicData into tPicFolder
put specialfolderpath("documents") & "/StoreddPics/" & tPicFolder into tFolderPath
put tCarID & "_" & tPicNum & ".png" into tPicName
export image ID sTheNewImage_ID to URL("binfile:" & tFolderPath & "/" & tPicName) as PNG
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Can't View Exported Image
Android is sandboxed and the image might go into the private documents area of the app. It will not be saved to the public shared documents folder so if you are using a file manager to look for it, it won't be there. You can't see the app's document folder without rooting the device.Prabhavins wrote:Hi Klaus,
I get the result as empty but i cant view the image in documents folder in android.
To see if the image was saved, you can ask in a script.
Code: Select all
answer there is a file specialfolderpath("documents") & "/success.jpg"
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 5
- Joined: Thu Jun 29, 2017 1:00 pm
Re: Can't View Exported Image
Hi,
But i have to view the image again in my application from the saved path.How can i do that?
Please advise.
Regards,
Prabha.M
But i have to view the image again in my application from the saved path.How can i do that?
Please advise.
Regards,
Prabha.M
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Can't View Exported Image
Create an image object and assign the file path:Prabhavins wrote:But i have to view the image again in my application from the saved path.How can i do that?
Code: Select all
create img "display"
set the filename of img "display" to specialfolderpath("documents") & "/success.jpg"
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 5
- Joined: Thu Jun 29, 2017 1:00 pm
Re: Can't View Exported Image
Hi,
Thanks for the suggestions.
I am trying to upload profile image and change the profile image image whenever i wish in my app. I am using sqllite database. Can we use any other database?
I am struck with how to resize the large image into specified width and height without loss of quality.
please advise.
Regards,
Prabha
Thanks for the suggestions.
I am trying to upload profile image and change the profile image image whenever i wish in my app. I am using sqllite database. Can we use any other database?
I am struck with how to resize the large image into specified width and height without loss of quality.
please advise.
Regards,
Prabha
Re: Can't View Exported Image
Hi Prabha,
Hint: Look up "resizequality" in the dictionary.
Best
Klaus
look up "revopendatabase" in the dictionry to see a list of all LC supported database types.Prabhavins wrote:I am trying to upload profile image and change the profile image image whenever i wish in my app. I am using sqllite database. Can we use any other database?
Do you want to talk about this? Maybe we can help.Prabhavins wrote:I am struck with how to resize the large image into specified width and height without loss of quality.
Hint: Look up "resizequality" in the dictionary.
Best
Klaus