It is currently Mon Sep 21, 2026 8:14 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Script-fu (gimp-xcf-save)
PostPosted: Sat Mar 09, 2019 6:45 pm  (#1) 
Offline
New Member

Joined: Mar 09, 2019
Posts: 2
GIMP Version: 2.8.14
Operating System: Linux
OS Version: Ubuntu 16.04
GIMP Experience: Intermediate Level



I'm fighting a problem when attempting to save a multi-layer file using the script-fu gimp-xcf-save function. When called from a Scheme script, gimp-xcf-save saves only the layer passed as the <drawable> parameter, blended with the layers above it, if any. But what is saved to the .xcf file is a single flattened layer, not all the separate layers. Reportedly (I haven't yet tested it) the python-fu version of this function, pdb.gimp_xcf_save(), will accept Python's null value 'None' in place of the <drawable> parameter and then save all layers separately to the .xcf file, but this appears not to be the case with the Scheme version of the function.

Does anyone know what's happening here, or why the function does not behave as expected? Is this a known issue? If you happen to have a tested, working snippet of code that successfully saves multi-layer .xcf files, I would love to compare it to what I'm running.

Thanks!


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Script-fu (gimp-xcf-save)
PostPosted: Sun Mar 10, 2019 12:38 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Strange. I suspect the "drawable" parameter is there only to align xcf-save with other saves (png-save, jpg-save) that indeed save only a layer. But as fas as I can tell, in Python, it is ignored, and whether it is None or any random layer, the whole image is saved with the layers (and layer groups...) untouched.

And as far as I known this corner of the Python API is just a facade on the script-fu API so this should also be true for script-fu...

_________________
Image


Top
 Post subject: Re: Script-fu (gimp-xcf-save)
PostPosted: Sun Mar 10, 2019 12:42 pm  (#3) 
Offline
New Member

Joined: Mar 09, 2019
Posts: 2
What I was hoping for is some value equivalent to Python's 'None' that might get past Scheme's type checking. Theoretically, '() should do it, but the interpreter pukes on that. Looks like I'll port to Python.


Top
 Post subject: Re: Script-fu (gimp-xcf-save)
PostPosted: Sun Mar 10, 2019 4:19 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
RayInLA wrote:
Looks like I'll port to Python.


Welcome to the 3rd millenium :)

_________________
Image


Top
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group