On Fri, May 29, 2009 at 3:59 PM, Ryan Krauss <ryanli...@gmail.com> wrote:
> Thanks David. I stumbled onto that solution just before I checked my email
> This does the trick of creating the file to go to PNG:
> img2 = pdb.gimp_edit_paste_as_new()
> It does work nice and doesn't seem to take too long.
> So, my script does almost everything that I want. One last annoyance is
> that I can't seem to get the window title to change from Untitled-N.0 after
> the XCF save to the XCF filename. Neither of these seem to set the window
> pdb.gimp_xcf_save(1, img, drawable, xcf_path, xcf_path)
> pdb.gimp_file_save(img, drawable, xcf_path, xcf_path)
Neither of the above set the filename.
You should do this.
image.filename = xcf_path
> It makes me a little nervous to close windows that don't have the filenames
> in the title and are not marked clean (no *). I can do this at the end of
> the script
> but the docs seem to say I shouldn't and that still doesn't set the window
> How should I save an XCF from a Python script (I assume either of the pdb
> save methods above) and how do I set the window title?
Saving XCF -- either of the methods you mentioned is fine.
You don't set the window title (except indirectly, as above)
> Should the image
> automatically be set as clean?
Yes, since you've saved in XCF. That is, setting it clean makes sense,
since that's what the GUI code does at the equivalent point in the
normal Save process.
The recently introduced Export framework may end up simplifying your
situation.. It considers a file 'clean' only when it has just been
saved to XCF (or xcf.gz, etc) format, and introduces a separate
'Export' action for producing a 'rendered result' in eg. PNG format.
Gimp-developer mailing list