It is currently Thu Oct 08, 2026 5:35 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: [Resolved: Buggy Programmer]Possible Bug -- Need Confirmation
PostPosted: Mon Aug 24, 2015 12:18 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
I have found a possible bug in G'MIC 1.6.5.1 which I need confirmed before I file a bug report.
If you are running:
gimp 2.8 with full python support
gmic 1.6.5.1
(preferably on Debian or a derivitive (including Ubuntu 14.04 or mint 17.1))
Please try the attached script.

Proper response should be your images active layer filled with plasma noise.

To test:
Install the attached file to your plugins folder
(make sure it's is executable)
It adds a big button to your menu bar, so delete it after test.
start gimp from the command line as:
gimp --verbose

Then from gimp:
Filters->G'MIC
set output messages to Very verbose (console)
And watch for error windows.

The command line output I am getting is:
RuntimeError: calling error
[gmic]-1./ Start G'MIC interpreter.
[gmic]-1./gimp_plasma/*if/ Force image [0] to be in RGB mode.
[gmic]-1./gimp_plasma/*if/ Fill image [0] with random values, in range [0,255].
[gmic]-1./gimp_plasma/ Draw plasma fractal on image [0], with alpha 1, beta 7.66 and scale 2.
[gmic]-1./gimp_plasma/ Normalize image [0] in range [0,255].
[gmic]-1./gimp_plasma/*substitute/ Input file '6-8' at position 1
[gmic]-1./gimp_plasma/*substitute/ *** Error *** Unknown filename '6-8'.
[gmic]-1./gimp_plasma/ Abort G'MIC interpreter.


But there are no file operations going on in the plug-in I wrote (which was previously working).
[EDIT: forgot the file !]

[EDIT2 I forgot to make a small change in the code. The newer gmic requires three more arguments than the first one did, the second zip corrects this.]


Attachments:
gmic-bug-test-2.py.zip [657 Bytes]
Downloaded 79 times
gmic-bug-test.py.zip [650 Bytes]
Downloaded 81 times

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Last edited by jazzon on Mon Aug 24, 2015 2:09 pm, edited 4 times in total.
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Possible Bug -- Need Confirmation
PostPosted: Mon Aug 24, 2015 12:34 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Independently of any GMIC bug:
noiseLayer = pdb.gimp_image_get_active_drawable(inImage)


It's cleaner to do:
noiseLayer = inImage.active_drawable


But normally, this very drawable is already given to you as the 'inDrawable' argument...

_________________
Image


Top
 Post subject: Re: Possible Bug -- Need Confirmation
PostPosted: Mon Aug 24, 2015 12:40 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
LOL, leave it to you to see that!

This was my first ever plug-in, and the whole code is really really messy.
I stripped it down for this test.

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: Possible Bug -- Need Confirmation
PostPosted: Mon Aug 24, 2015 12:45 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
Added a second zip file to correct for a change in GMIC's code base between teh original version and the new version.

Ofnuts No I did not change the other line ;)

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: Possible Bug -- Need Confirmation
PostPosted: Mon Aug 24, 2015 2:04 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
You have to remove the 'spaces' in your list of arguments when calling G'MIC.
Spaces in G'MIC are item separator, so it's very important not to add them everywhere :)


Top
 Post subject: Re: Possible Bug -- Need Confirmation
PostPosted: Mon Aug 24, 2015 2:09 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
OK,

It turns out that it is not a bug.

For future reference of script writers, a G'MIC command string looks like this (sample for the plasma filter):
"-gimp_plasma  1.0,7.66,2,1,0,128,128,128"

in python that would properly be written as:
"-gimp_plasma  1.0, 7.66, 2, 1, 0, 128, 128, 128"

Which as it turns out thoroughly confuses G'MIC.
In a G'MIC command string, once you type in a value which part of the comma separated values, there can be no spaces. At all. What-so-ever. etc.

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: [Resolved: Buggy Programmer]Possible Bug -- Need Confirmation
PostPosted: Mon Aug 24, 2015 2:11 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
Ronounours LOL Was already loaded to this page so I didn't see your post ahead of mine! Figured it out by accident when I rewrote teh code for the third time!

Thank you for your response though.

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: [Resolved: Buggy Programmer]Possible Bug -- Need Confirmation
PostPosted: Mon Aug 24, 2015 3:03 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Yes, as I said, space in G'MIC is an item separator, so if you put it in a list of arguments, it's like you have a shorter list of argument, followed by another command.


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group