GNOME Bugzilla – Bug 327681
Script fu - Cool Metal problem
Last modified: 2008-08-23 16:30:09 UTC
Steps to reproduce: 1. Start GIMP, Undo list should be opened 2. Main menu -> File/Open... "para6x.png" <-Important!! 3. Select all white area with Magic Wand 4. Right click menu -> Select/Invert 5. Main menu -> Edit/Copy 6. Main menu -> File/New... (Settings can be anything) 7. In the main menu of the new window -> Edit/Paste 8. In the main menu of the new window -> Script-Fu/Alpha to Logo/Cold Metal 9. In Cold Metal box (Settings can be anything) click on "OK" 10. Then we will get a cute error message (see below), click on "OK" 11. Then if we click on the Undo list to undo this half-maded thing, GIMP will freeze. If we want to close it, a Windows error message will be shown "A program nem válaszol" it means that the application stops responding. Te Cool Metal error message: Cool Metal Message Error while executing (script-fu-cool-metal-logo-alpha 2 6 101 '(176 87 87) "Mexican flag" TRUE) ERROR: Procedural database execution failed: (gimp_edit_copy 6) Stack trace: Other information: Yes, I have. The important file (as I mentioned) "para6x.png" can be download (freely of course :) from http://members.chello.hu/peter.nyitrai/para6x.png Good luck!
Created attachment 57636 [details] file supposedly causing the problem Please attach files to bugzilla, in particular such small ones. The tend to get lost if they're only linked to.
I reproduced the problem using the supplied set of steps. The problem is the result of a missing step. Step 7 creates a floating layer. You did not anchor this layer before running the script which causes the script to fail during gimp-edit-copy. The simple fix is to anchor the layer before running the script. To avoid the problem, replace steps 6 and 7 by Edit -> Paste as New. This just leaves the question as to whether the script should automatically anchor any floating layer before applying the effect.
The real problem is step 11, the freeze. The error message itself - despite being not the desired result - is expected with the current implementation, but GIMP shouldn't hang.
I did not experience a freeze of GIMP when using version 2.2.10 under Linux.
Gimp dont freeze for me too (Gimp v2.2.11 Ubuntu Dapper). But see the error message on Gimp edit copy.
Using 2.2.14 on Sparc/Solaris, I cannot reproduce the freeze. The undo stack is completely broken by the aborted script though. (gimp:23635): Gimp-Core-CRITICAL **: file gimpimage-undo.c: line 56: assertion `gimage->pushing_undo_group == GIMP_UNDO_GROUP_NONE' failed
We don't really care whether it's broken on 2.2. Is it still a problem on GIMP 2.3?
Using GIMP from SVN, I get two error messages but no critical warnings or freezes or anything like that. The script probably just needs a few changes to handle floating selections better. Cool Metal Message Procedural database execution of gimp-edit-copy failed on invalid input arguments: GIMP Message Procedure 'gimp-edit-copy' has been called with an invalid ID for argument 'drawable'. Most likely a plug-in is trying to work on a layer that doesn't exist any longer.
After some further analasys of this bug, I got to the conclusion that it is caused by the fact the layer which we are working on is floating. All I had to do was to add a check to see if the layer was floating. I checked my solution in various situations and it works fine as far as I can see. The patch will be attached in a moment.
Created attachment 117267 [details] [review] Patch for fixing the error in the script The error was caused by the fact that the layer he worked on was floating. I added several lines of code (see the diff) inside the "script-fu-cool-metal-logo-alpha" to fix the bug.
Thanks. Let's finally close this then... 2008-08-23 Sven Neumann <sven@gimp.org> * plug-ins/script-fu/scripts/coolmetal-logo.scm: applied patch from LightningIsMyName. Changes the script to not break if called on a floating selection (bug #327681).