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 327681 - Script fu - Cool Metal problem
Script fu - Cool Metal problem
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Script-Fu
2.2.x
Other All
: Normal minor
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-01-19 09:49 UTC by Nyitrai Péter
Modified: 2008-08-23 16:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file supposedly causing the problem (1.48 KB, image/png)
2006-01-19 10:34 UTC, Michael Schumacher
  Details
Patch for fixing the error in the script (664 bytes, patch)
2008-08-23 14:18 UTC, LightningIsMyName
none Details | Review

Description Nyitrai Péter 2006-01-19 09:49:51 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!
Comment 1 Michael Schumacher 2006-01-19 10:34:36 UTC
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.
Comment 2 Kevin Cozens 2006-01-19 17:25:49 UTC
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.
Comment 3 Michael Schumacher 2006-01-19 18:08:41 UTC
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.
Comment 4 Kevin Cozens 2006-01-20 00:20:23 UTC
I did not experience a freeze of GIMP when using version 2.2.10 under Linux.
Comment 5 Muthiah Annamalai 2007-01-19 00:42:34 UTC
Gimp dont freeze for me too (Gimp v2.2.11 Ubuntu Dapper).
But see the error message on Gimp edit copy.
Comment 6 Eric Lamarque 2007-04-27 15:32:10 UTC
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
Comment 7 Sven Neumann 2007-04-27 18:23:55 UTC
We don't really care whether it's broken on 2.2. Is it still a problem on GIMP 2.3?
Comment 8 Sven Neumann 2007-05-21 15:44:00 UTC
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.
Comment 9 LightningIsMyName 2008-08-23 14:16:09 UTC
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.
Comment 10 LightningIsMyName 2008-08-23 14:18:00 UTC
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.
Comment 11 Sven Neumann 2008-08-23 16:30:09 UTC
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).