Page 1 of 1

Saving images in iOS - results corrupt

Posted: Wed Apr 09, 2014 5:27 am
by scotttyang
I am trying to save an image for example image "a" to the specialfoldpath ("Documents") of iOS. It seems to save, but the file saved is corrupt. When I open the file in Preview, it says,

"The file "9372.png" could not be opened.
It may be damaged or use a file format that Preview doesn't recognize."


This is what I have,

set the defaultFolder to specialFolderPath("Documents")
put image "a" into url ("binfile:9371.png")

or

put the imagedata of image "a" into tPic
put tPic into url ("binfile:9371.png")


any suggestions please!!

Scott

Re: Saving images in iOS - results corrupt

Posted: Wed Apr 09, 2014 7:41 am
by jmburnod
Hi Scott,

Try this

Code: Select all

get the text of img "9372.png"
put specialfolderPath("documents") & "/" & "9372.png" into tPath
put it into url("binfile:" & tpath)
Kind regards
Jean-Marc

Re: Saving images in iOS - results corrupt

Posted: Wed Apr 09, 2014 12:31 pm
by Klaus
Hi Scott,

or use "export", which has always worked for me:
...
put specialfolderPath("documents") & "/9372.png" into tPath
export img "a" to file tPath as PNG
...

Best

Klaus