Is there anyone who understands why an object exported as .png and saved locally can not be read back? It seems that the file somehow become corrupt.
It does not matter if I export it as anything other than .png, it just does not work.
And this does not work regardless of platform.
set the defaultFolder to specialFolderPath("documents")
export snapshot from group tGroup of stack "Drawing" to URL("file:image.png") as png
///Peter
Objects that are exported to file becomes corrupt
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Objects that are exported to file becomes corrupt
/*Whats all the fuss with c# ?*/
Re: Objects that are exported to file becomes corrupt
Hi Peter,
if you use "url" you need to specify "binfile" instead of "file" because if you use file LC will convert line endings to a platform specific form and the image will not work anymore.
both of the code variants work
Kind regards
Bernd
if you use "url" you need to specify "binfile" instead of "file" because if you use file LC will convert line endings to a platform specific form and the image will not work anymore.
both of the code variants work
Code: Select all
set the defaultFolder to specialFolderPath("documents")
export snapshot from group 1 to url "binfile:image.png" as png
Code: Select all
set the defaultFolder to specialFolderPath("documents")
export snapshot from group 1 to file "image.png" as png
Bernd
Re: Objects that are exported to file becomes corrupt
If in doubt ALWAYS look up the dictionary!
The entry about "export snapshot..." does not leave any doubt about the snytax:
...
export snapshot [from rect[angle] rectangle] of object [(with | without) effects] ... | [from object] [at size width, height] [{with|and} metadata metadata] to {file filePath | container} [as format] [with mask maskFile]
...
The entry about "export snapshot..." does not leave any doubt about the snytax:
...
export snapshot [from rect[angle] rectangle] of object [(with | without) effects] ... | [from object] [at size width, height] [{with|and} metadata metadata] to {file filePath | container} [as format] [with mask maskFile]
...