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 167964 - Batch mode may not work when using a batch interpreter other than plug-in-script-fu-eval
Batch mode may not work when using a batch interpreter other than plug-in-scr...
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-02-20 17:54 UTC by Kevin Cozens
Modified: 2006-06-27 18:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kevin Cozens 2005-02-20 17:54:34 UTC
I received a report which stated that a shell script which used GIMP in batch
mode worked when used with Script-Fu but failed to run when it was used with
Tiny-Fu. The problem appears to be in the batch_run() routine in the batch.c file.

The batch_run() routine checks whether the batch interpereter being used is
plug_in_script_fu_eval. If it is, and if the first "command" after the -b is -,
then the interpreter is run using GIMP_RUN_INTERACTIVE. If either condition is
not met, the interpreter is run using GIMP_RUN_NONINTERACTIVE.

The use of interactive vs. non-interactive mode should not depend on the name of
the batch interpeter. There should be some means to indicate which mode should
be used.
Comment 1 Kevin Cozens 2005-02-20 18:10:25 UTC
One way to fix this would be to add a command line parameter to specify the mode
to use when calling the batch interpeter. A simpler method is to look for the
existance of - immediately following the -b.

In other words, calling batch mode using
   gimp -b - <command>
would call the batch interpreter in interactive mode.

Calling batch mode using
   gimp -b <command>
would call the batch interpreter in non-interactive mode.

The changes to batch_run() to accomplish the above were trivial. I'm currently
testing the changes with Script-Fu and Tiny-Fu. If it works as expected, I'll
attach a patch file to this report.
Comment 2 Sven Neumann 2005-02-20 18:20:02 UTC
I don't follow your argumentation at all. 'gimp -b -' is just an backward
compatible way of saying 'gimp -b plug_in_script_fu_text_console'. You are right
that it's wrong to call it in a different run-mode. The right fix here is to
always call batch commands with GIMP_RUN_NONINTERACTIVE.

If the user wants an interactive batch processor, she can call one by specifying
a procedure that provides one. The run-mode passed to the procedure should
actually not matter at all and would best be ignored.
Comment 3 Sven Neumann 2005-02-20 18:40:15 UTC
That should have read, it's a short-form for

  gimp-2.3 --batch-interpreter=plug_in_script_fu_text_console --batch

And yes, this doesn't work because script_fu_text_console insists on being
called in interactive mode. But it would be easy to fix this by removing the
run-mode check.
Comment 4 weskaggs 2005-02-25 20:32:58 UTC
confirming on the basis of comments
Comment 5 Sven Neumann 2005-10-20 10:44:45 UTC
2005-10-20  Sven Neumann  <sven@gimp.org>

	* app/batch.c (batch_run): always call the batch interpreter in
	NON-INTERACTIVE mode (see bug #167964).

	* plug-ins/script-fu/script-fu-text-console.c: removed the run-mode
	check.

Comment 6 weskaggs 2006-05-20 23:39:18 UTC
Should this be resolved as FIXED, then?
Comment 7 Sven Neumann 2006-06-27 18:14:08 UTC
I think so. Closing as FIXED.