09-25-2022, 06:18 PM
Ofnuts Wrote:Could be a gimp-console vs gimp thing.
This then gives hope that the developers are at least on the right track. So it remains the correct implementation to find the error / the cause why it does not work in Windows.
Ofnuts Wrote:Yes, but... when you call the gimp command, it checks if there is an instance running already (unless you use the --new-instance parameter) and if it finds one it passes it the command arguments …
And here the same as before: It gives hope and it remains to be seen until the bug is fixed in Gimp for Windows platform.
Ofnuts Wrote:… and the just started instance exits immediately
Something is wrong here, because just such behavior would then explain the essential problem here.
It makes no sense to terminate an already running instance without being asked, and even more so if there is a possibility to terminate it on demand, e.g. via (gimp-quit 0).
And just to be on the safe side, I'll mention it here again: no, unfortunately this is not currently the case in Windows. When executing a Gimp command, an already running instance is not taken into account to feed it with the command, but a new process instance is started, which makes the whole thing very slow.
Ofnuts Wrote:This is not the same as the started instance continuing in the background (as with START). Since your batch file waits for the instance it started, it sees that instance terminate and continues. Unless, as above, a gimp-console vs gimp thing.
I'm afraid there's a lot of confusion here: As described above it is processed especially in this case classically line by line and without START "" gimp … (in separated process instances), and yet, a separate process instance is executed for each Gimp command line.
Ofnuts Wrote:Simplicity and performance are not always synonyms.
That is true and I fully agree, however, I did not claim the opposite here.
Ofnuts Wrote:But if you make that a true script, then you can possibly compute some of the scale and rotation arguments for some well picked initial arguments, so you likely need fewer parameters than you think.
That may be already so. I just wanted to point out that the whole structure should remain clear, because some arguments and other things will follow and the whole thing should remain clear and easy to maintain. Otherwise it is an unattractive nesting. But all this is secondary, because in case of need it would be possible to create an intermediate procedure, which summarizes everything to one line of code in the end, to run only one Gimp instance.
So the primary thing now would be to find out why Gimp in Windows does not consider an already running process instance, but always executes a new instance.
Ofnuts Wrote:And btw, while we are at it, rotation and scaling introduce some blur. If you do two operations (one scaling, or rotation), you blur twice. There are gimp-drawable-transform-2d and gimp-drawable-transform-2d-default functions that do both in one operation so you only blur once.
That's fine to know. Many thanks for this valuable tip! Very fine!