Gimp-Forum.net
ComicBook - RuntimeError: cancelled - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: ComicBook - RuntimeError: cancelled (/Thread-ComicBook-RuntimeError-cancelled)

Pages: 1 2


ComicBook - RuntimeError: cancelled - Krikor - 08-02-2023

Salut @cli345,

These days I noticed in one of your posts the link to: Photo To Cartoon - https://github.com/cl4cnam/gimp_cartoon_plugin

So today, I downloaded and installed the plugin, but only to be met with the following error:

Code:
[b]An error occurred running python-fu-bd

RuntimeError: cancelled

Traceback (most recent call last):
 File "C:\Gimp-2.10.28_Portable_32-64bit-Win\lib\gimp\2.0\python/gimpfu.py", line 740, in response
   dialog.res = run_script(params)
 File "C:\Gimp-2.10.28_Portable_32-64bit-Win\lib\gimp\2.0\python/gimpfu.py", line 361, in run_script
   return apply(function, params)
 File "C:\Gimp-2.10.28_Portable_32-64bit-Win\Preferences\plug-ins\PluginsUso\bede2.10.py", line 35, in bd
   pdb.plug_in_gmic_qt(img, layer, 1, 0, '-fx_curves_interactive 7,0,1,7,0,0,'+pointLum+',100,100,-1,0,0,'+pointSat+',100,100,-1,0,0,100,100,-1,0,0,100,100,-1,')
RuntimeError: cancelled[/b]


On the github page there is the following notice:

"On Windows, if the plugin does not work, delete the first line of the file "bede2.x.py" ("new line" character included)."

I believe that the first line would be the fifth line, so I added a '#' to comment it out:

-----------------------------------------------------------------
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# éèà

#from gimpfu import *
import os

baseDir = os.path.expanduser('~/.gimpTranslation')
-----------------------------------------------------------------

But then when restarting the plugin it no longer appears in the menu ➤ Filters ->Artistic -> Bede...

I'm not sure if the first line would actually be the fifth or if I should uncomment line 1.

I'm using G'MIC version 3.1.6

Is there any way to make the plugin work with my Gimp?

PS.: Using the version via G'MIC I have no problems.

Thanks in advance.


RE: ComicBook - RuntimeError: cancelled - Ofnuts - 08-02-2023

If you comment out the from gimpfu import * the script won't work because gimpfu is the module with the whole API.


RE: ComicBook - RuntimeError: cancelled - Krikor - 08-02-2023

(08-02-2023, 02:42 PM)Ofnuts Wrote: If you comment out the from gimpfu import * the script won't work because gimpfu is the module with the whole API.

Salut Ofnuts,

Considering the caveat:
  "On Windows, if the plugin does not work, delete the first line of the file "bede2.x.py" ("new line" character included)."

And considering I'm a certified pyton noob, I had to try to remove what I assumed was the first line of the file.

Soon after, starting again from the original file, I removed line 1, which was already a comment ➤ #!/usr/bin/env python.

Only to be unsuccessful in getting the plugin to work.

Luckily the G'MIC version works beautifully.


RE: ComicBook - RuntimeError: cancelled - neurolurker - 08-02-2023

Krikor, I'm pretty sure the line

#!/usr/bin/env python

including the comment hashmark

has to be the first line in a PY file if you're on Windows.


RE: ComicBook - RuntimeError: cancelled - Krikor - 08-02-2023

(08-02-2023, 08:40 PM)neurolurker Wrote: Krikor, I'm pretty sure the line

#!/usr/bin/env python

including the comment hashmark

has to be the first line in a PY file if you're on Windows.

Hello Neurolurker,

In fact, literally this is the first line.
I thought that because it was a comment it would not be executed by the program.

However, even removing just the first line:
"#!/usr/bin/env python"
Nothing changes, the same error continues to be displayed after clicking ok.

Thanks for the help.


RE: ComicBook - RuntimeError: cancelled - PixLab - 08-03-2023

(08-02-2023, 07:31 PM)Krikor Wrote: which was already a comment ➤ #!/usr/bin/env python.

The shebang AKA hashbang AKA "#!" is not really a comment, note ➤ they are together ➤ the "#" (hash) and the "!" (bang)
the hashbang/shebang is here to define the environment/interpreter in a unix system (Linux, macOS), if you have different versions of python installed, /usr/bin/env will make sure the interpreter used is the first one on your environment's $PATH

https://www.google.com/search?channel=fs&client=ubuntu&q=%23%21%2Fusr%2Fbin%2Fenv+python

Anyway, I'm on Linux and it is not working either, I got the very same error, thus there is nothing to remove or comment Wink
I think the last time I used it I was on GIMP 2.10.22 or 28, and it was working, now I'm on GIMP 2.10.34 same error as you,
BUT I don't think that's the problem.

Look before the last line on the error, it is calling plug_in_gmic_qt Wink
The script seems to call a G'MIC thing that has changed in G'MIC (I'm using G'MIC 3.2.6), that could be the problem, the update of G"MIC... Idea
But I'm no programmer, thus all I wrote can be BS Big Grin

Code:
pdb.plug_in_gmic_qt(img, layer, 1, 0, '-fx_curves_interactive 7,0,1,7,0,0,'+pointLum+',100,100,-1,0,0,'+pointSat+',100,100,-1,0,0,100,100,-1,0,0,100,100,-1,')

[attachment=10151]


RE: ComicBook - RuntimeError: cancelled - SOLVED - Krikor - 08-03-2023

Hi PixLab,

I didn't know any of this related #! (hashbang).
Thank you for your class in this regard. It's always good to have some clue what those hieroglyphs in python code mean. :-)

Years ago I even started to learn to program in python. I got help from Tim ( TimTrans, Transdoduction * or something like that). He even had an area on GimpLearn.net that taught the first steps in python.

I even used an app that taught python and it was doing great.  

At the time I was able to create small python programs and run them successfully  Rolleyes
I was excited, but when I tried to apply what I had learned directly to use with The Gimp... I was disappointed.   Confused
A lot of other codes and requirements were needed. It was almost another programming language (pdb, I don't remember anymore...), so I gave up.  Sad

Nowadays I am an honorary representative of the Society of Programming Noobs Blush

==============================================================================================================
Btw...

I think I created a request in this thread that was already answered from the beginning.

On the GitHub website there is the following note:

Quote:
"For G'MIC 2.9.8 and later, don't use this but use "Filters -> G'MIC-Qt -> Artistic -> Comic Book"



I had read that note, but somehow my brain in the act of instant translation played a trick on me and perhaps confused the G'MIC version with the Gimp version.

Therefore, I believe this plugin will only work for G'MIC versions below 2.9.8.

Thank you all for your attention!


RE: ComicBook - RuntimeError: cancelled - rich2005 - 08-03-2023

You are correct, a bit easier in linux where I can easily swap versions of gimp_gmic_qt in and out.

Version 2.9.7 works but 3.0.0 does not work.

I can get the plugin to show and sort-of run by changing line 35, the first 7 to some other number, 6 or 8 it is not bothered.
pdb.plug_in_gmic_qt(img, layer, 1, 0, '-fx_curves_interactive 7,0,1,7,0,0,'+pointLum+...etc
...but.. it makes a cartoon effect, not the same bright version as the original.

Question, Is there any reason why you need the old plugin ?


RE: ComicBook - RuntimeError: cancelled - PixLab - 08-03-2023

(08-03-2023, 08:40 AM)rich2005 Wrote: Question, Is there any reason why you need the old  plugin ?

I don't really recall, thus not sure at all, but if and only if I trust my memory, in G'MIC "recently" (a year or more or for the version 3) I kind of recall that they shorten the length of those number between parenthesis
Code:
pdb.plug_in_gmic_qt(img, layer, 1, 0, '-fx_curves_interactive [u]7,0,1,7,0,0,'+pointLum+',100,100,-1,0,0,'+pointSat+',100,100,-1,0,0,100,100,-1,0,0,100,100,-1[/u],')

removing like 4 or 5 numbers or more or less between commas (I suppose that +pointSat+ is a concatenated number, as well as +pointLum+ as for me the "+" looks like javascript to concatenate a variable or whatever, but I sure I'm just speculating), but the removal of some parameters (numbers) I feel I read it on pixls.us somewhere, like David Tschumperlé explaining the purpose... but now writing it... > I'm not sure anymore Sad

@Krikor
(08-03-2023, 07:03 AM)Krikor Wrote: At the time I was able to create small python programs and run them successfully  Rolleyes

So you are already way better than me! I just tried to "fix" 1 or 2 Pocholo's bugs and add more options on its scripts like 2 years or more ago, I did never ever write a python script by myself and never will.

(08-03-2023, 07:03 AM)Krikor Wrote: It was almost another programming language (pdb, I don't remember anymore...), so I gave up.  Sad

EXACTLY, me too -> pdb. gimp_whatever() this is where I gave up too, I mean completely gave up, for me it looks like static/immutable things, thus you need to learn a huge list of... pdb.things, thus no... it's not for me, in all case I did not went further, so I am missing many good things for sure, but I'm not interested anymore Wink


RE: ComicBook - RuntimeError: cancelled - Krikor - 08-03-2023

Ehh... Not really.
If there was an option I would rather not have to open the G'MIC.

I've had filters on my G'MIC bookmarks gone overnight due to G'MIC updates.
Samj CorLine, is an example of these cases.

The important thing is to be able to use the plugin.