After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 317634 - batch mode globbing broken
batch mode globbing broken
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Script-Fu
git master
Other All
: Urgent normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on: 168290
Blocks:
 
 
Reported: 2005-09-30 19:02 UTC by Akkana Peck
Modified: 2007-10-21 20:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix STRINGARRAY handling for backwards compatability. (5.46 KB, patch)
2007-10-20 19:44 UTC, Kevin Cozens
needs-work Details | Review

Description Akkana Peck 2005-09-30 19:02:40 UTC
Follow the steps for the second example (batch unsharp-mask on multiple files) in:
http://gimp.org/tutorials/Basic_Batch/
Even if you add an extra -b before the '(gimp-quit 0)', it still fails.

% gimp-2.3 -i -b '(batch-unsharp-mask "*.jpg" 5.0 0.5 0)' -b '(gimp-quit 0)'
This is a development version of The GIMP.
Debug messages may appear here.

No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
batch command: experienced an execution error.
plug_in_close: plug-in aborted before sending its procedure return values

Passing just gimp-quit gives the same error:

% gimp-2.3 -i -b '(gimp-quit 0)'
This is a development version of The GIMP.
Debug messages may appear here.

No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
plug_in_close: plug-in aborted before sending its procedure return values

The Python example Yosh posted recently,
http://www.mail-archive.com/gimp-user@lists.xcf.berkeley.edu/msg08897.html
fails in the same way with the same error message.

The script-fu example works in 2.2 (I don't have a python enabled 2.2 handy to
test the python example). Though the script-fu example seems to fail even in 2.2
on mac and windows; is batch mode linux only?
Mitch tracked it down to this check-in:
<mitch> 2005-03-01  Kevin Cozens  <kcozens@cvs.gnome.org>
<mitch>  * plug-ins/script-fu/siod-wrapper.c: Fixed marshalling code to
<mitch>  treat string arrays as arrays instead of lists of strings. Last
<mitch>  part of the fix for bug #168290.

Apparently file-glob does different things in HEAD vs 2.2.
Comment 1 Kevin Cozens 2005-10-01 04:42:22 UTC
This report combines three separate issues.

Issue 1
The batch script works with GIMP 2.2 under Linux but not on a Mac or in Windows.

Issue 2
The change in the CVS version of GIMP which treats string arrays as arrays.

Issue 3
The message displayed when gimp-quit is called.
Comment 2 Sven Neumann 2005-10-01 09:05:51 UTC
I don't think it deals with anything but issue #2.

#1 has already been taken care of by compiling gimp-console by default. #3 is a
trivial issue.
Comment 3 Sven Neumann 2005-10-05 11:24:05 UTC
Reverted the incompatible changes. Batch mode works again.

2005-10-05  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/siod-wrapper.c: reverted changes to handling
	of string arrays to stay backward compatible (see bug #168290 and
	bug #317634).

	* plug-ins/script-fu/scripts/font-map.scm: reverted change that
	was done to adapt to above changes (see bug #308681).

Comment 4 Sven Neumann 2007-10-18 15:24:12 UTC
Looks like this change crept back in when the switch to TinyScheme was made. Reopening.
Comment 5 Kevin Cozens 2007-10-20 19:44:52 UTC
Created attachment 97527 [details] [review]
Patch to fix STRINGARRAY handling for backwards compatability.

This patch doesn't insure protection of the data cells being used in the list being built in the STRINGARRAY case which starts at line 1411.

The TinyScheme gc fix in SourceForge (see changes between version 1.8 and 1.9 of scheme.c) should be reviewed for use in Script-Fu's TinyScheme. The change shifts responsibility for protection of cells from Scheme/C interface code (as we have it now) to the Scheme interpreter.
Comment 6 Kevin Cozens 2007-10-21 20:40:39 UTC
2007-10-21  Kevin Cozens  <kcozens@cvs.gnome.org>

        * plug-ins/script-fu/scheme-wrapper.c: Reverted changes in handling
        of string arrays to stay backwards compatible (see bug #317634).

        * plug-ins/script-fu/scripts/font-map.scm: Updated based on change
        in handling of string arrays listed above.