GNOME Bugzilla – Bug 167964
Batch mode may not work when using a batch interpreter other than plug-in-script-fu-eval
Last modified: 2006-06-27 18:14:08 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.
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.
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.
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.
confirming on the basis of comments
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.
Should this be resolved as FIXED, then?
I think so. Closing as FIXED.