RSS/Atom feed Twitter
Site is read-only, email is disabled

seeking file path of open image

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

seeking file path of open image Steven Howe 03 Apr 07:09
  seeking file path of open image Manish Singh 03 Apr 08:14
Steven Howe
2007-04-03 07:09:38 UTC (almost 18 years ago)

seeking file path of open image

Hello,
I'm writing to this list a lot. Hope that's not a problem. I'd like to 'checkpoint' my work after each Python-Fu script is run. I building a image with multiple layers, using the Antiquing guide I found on the gimp site as a learning tool. Naturally I need store the image in the XCF file format.
I think I want to use pdb.gimp_file_save(), I'd: 1) get the / from the open active image (using what I don't know)
2) get the filename, (using os.path.basename) 3) carve off the extension, and add '.xcf' (using ckptName='%s.%s' % ( fname[:fname.rfind('.')] , '.xcf' ) ... and use the *pdb.gimp_file_save()*.

So the question is, how to get the full pathname for an image?

Thanks for all the good an quick support.

Steven Howe

Manish Singh
2007-04-03 08:14:29 UTC (almost 18 years ago)

seeking file path of open image

On Mon, Apr 02, 2007 at 10:09:38PM -0700, Steven Howe wrote:

Hello,
I'm writing to this list a lot. Hope that's not a problem. I'd like to 'checkpoint' my work after each Python-Fu script is run. I building a image with multiple layers, using the Antiquing guide I found on the gimp site as a learning tool. Naturally I need store the image in the XCF file format.
I think I want to use pdb.gimp_file_save(), I'd: 1) get the / from the open active image (using what I don't know)
2) get the filename, (using os.path.basename) 3) carve off the extension, and add '.xcf' (using ckptName='%s.%s' % ( fname[:fname.rfind('.')] , '.xcf' ) ... and use the *pdb.gimp_file_save()*.

So the question is, how to get the full pathname for an image?

Use the "filename" attribute on the Image object. (It's just a wrapper around gimp-image-get-filename)

-Yosh