Bug 215 : save() and saveFrame() use different directories to put images
Last modified: 2006-09-25 10:46



Jon Buller
Assigned To:

Attachment Type Created Size Actions

Description:   Opened: 2005-11-17 14:23
On WinXP using ver 0093 or ver 0095, I have some code with the line save
("image.tif"); and when it runs, the image is nowhere to be found, but
replacing that with saveFrame ("image-####.tif"); leaves the saved image
file in my sketch folder.

As it turns out, I found the save location a few minutes ago. save() does
not put the image in the sketch folder like saveFrame() does, but instead,
puts it beside the processing executable. i.e. It should be in
c:\Documents and Settings\jbuller\Desktop\sketch\image.tif but is instead
located at c:\Program Files\processing\image.tif
Additional Comment #1 From fry 2005-11-18 06:19
that's because saveFrame() is a method on PApplet, which knows where it's
being run from, and save() is a method of PImage (which has no concept of
the host applet or where it's being run), but can take absolute paths (the
PApplet method does not).

see the javadoc for save():
Additional Comment #2 From Jon Buller 2005-11-18 10:39
Might I suggesty that you update the .../reference/save_.html and
.../reference/saveFrame.html pages in the download file to note where the
current working directory is then? Those pages are what I was looking at
when I was altering the code, and it left me a bit confused when the files
didn't appear as I expected them.
Additional Comment #3 From fry 2005-11-18 10:43
k, i'll move this over to being a reference bug so that it'll be in casey's queue to fix it.
Additional Comment #4 From fry 2006-09-25 10:46
for anyone who comes across this bug... for revision 0116, save() and
saveFrame() will behave similarly, and the reference will be updated