We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsWebsite,  Documentation,  Book Bugs › Save works in signed applets not stated
Page Index Toggle Pages: 1
Save works in signed applets not stated (Read 1669 times)
Save works in signed applets not stated
Jan 1st, 2009, 7:47am
 
http://processing.org/reference/save_.html

it says "It is not possible to use save() while running the program in a web browser."

I discovered that it does work when I self signed an applet, at least on mac with safari.
Re: Save works in signed applets not stated
Reply #1 - Jan 1st, 2009, 1:18pm
 
I think it is not an error, rather taking a simple path for newcomers...
Beside, using save() in a Web browser is prone to have lot of issues (or questions), like knowing where to save (system dependent, might need a file chooser or at least an input field, etc.).
Not to mention securities issues like erasing system files (but if you accept a signed applet, you assume it is trustworthy...).
Re: Save works in signed applets not stated
Reply #2 - Jan 1st, 2009, 10:01pm
 
For consistency, things should be the same, and as loadStrings() http://processing.org/reference/loadStrings_.html mentions the signing requirements I figured save() should as well.

Anyway, it might be nice to use  selectOutput() in a save() example. It took me a while to find. http://processing.org/reference/selectOutput_.html

Also, save() has no mention of paths, only file names, and apparently paths work just fine.

I understand simplifying stuff. I'm not sure whats best, but I agree that the current state is not in really error, but it may not be optimal.

Anyway is there a mention regarding the functionality of signed applets somewhere or do I have to look to java for that?

For most things the documentation has worked great for me. These are probably my only issues with it. With no java or C experience, I picked processing up just fine, and accomplished a lot quickly. I'm impressed. Thanks!
Re: Save works in signed applets not stated
Reply #3 - Jan 2nd, 2009, 12:00am
 
I am just expression my opinion/guesses, of course! Your input is useful in any case, I don't mean to put it down!

I believe (think/guess/remember...) that save() doesn't mention paths because it is precisely the kind of stuff which is not portable across systems/computers. But indeed they are useful if you just make a quick unsaved sketch (no data folder) and want to load a file on your hard disk (or avoid duplicating it in each sketch using it)...
Re: Save works in signed applets not stated
Reply #4 - Jan 2nd, 2009, 12:26am
 
Something along the lines of:

String path=selectOutput("Save your image");//Display OS specific save file dialog
if (path!=null) {save(path +".png");}// If a destination was chosen, save the current image as a png file where chosen.

would make make nice example code for save and selectOutput. Someone might not think that would work because save does not mention paths, but really, it's simple and quite useful.

I haven't tested that code, but something like it should work fine.
Page Index Toggle Pages: 1