Hum, I’m not sure what to do right now.
I’ll do some tests on my side, and hopefully will be able to reproduce the issue one way or another.
… and another trial
gmic v 2 apply_timeout “repeat 10000 osteo done”,-1 rm
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Set verbosity level to 2.
[gmic]-0./ Apply command ‘repeat 10000 osteo done’ on image [], with a timeout of -1 seconds.
[gmic]-0./apply_timeout/*if/*local/ Input image at position 0, with values (46,47,97,112,112,108,121,95,116,105,1(…)2,105,102,47,42,108,111,99,97,108,47) (1 image 27x1x1x1).
[gmic]-1./apply_timeout/*if/*local/ Set local variable ‘id=2468’.
[gmic]-1./apply_timeout/*if/*local/ Remove image [0] (0 images left).
[gmic]-0./apply_timeout/*if/*local/ Store image [] as variable ‘initial’
[gmic]-0./apply_timeout/*if/*local/ Set global variable ‘__done2468=0’.
[gmic]-0./apply_timeout/*if/*local/ Set global variable ‘__is_timeout2468=0’.
[gmic]-0./apply_timeout/*if/*local/ Execute 2 commands ‘repeat 10000 osteo done __done2468=1,d(…)$__done2468 break fi wait 100 while 1’ in parallel and wait thread termination immediately.
[gmic]-0./apply_timeout/*if/*local/*thread1/*do/*if/ Set global variable ‘__is_timeout2468=1’.
[gmic]-0./apply_timeout/*if/*local/*thread0/*repeat/ Load osteoblast nucleus example image
[gmic]-0./apply_timeout/*if/*local/*thread1/*do/*if/ *** Error ***
[gmic]-1./apply_timeout/*if/*local/ *** Error in ./apply_timeout/*if/*local/*thread1/*do/*if/ ***
[gmic]-1./apply_timeout/*if/*local/ Remove image [0] (0 images left).
[gmic]-0./apply_timeout/*if/*local/ Input image from variable ‘initial’, at position 0. (1 image 1x4x1x1).
[gmic]./apply_timeout/*if/*local/ *** Error *** G’MIC encountered a fatal error (images (0) and images names (1) have different size). Please submit a bug report, at: Issues · dtschump/gmic · GitHub
Still
gmic 0 apply_timeout “repeat 10000 osteo done”,-1 rm
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Input empty image at position 0 (1 image 0x0x0x0).
[gmic]-1./ Apply command ‘repeat 10000 osteo done’ on image [0], with a timeout of -1 seconds.
[gmic] *** Error in ./ *** Command ‘apply_timeout’: Time out (-1 seconds) for command ‘repeat 10000 osteo done’.
I may have installed pink
at some point but removed it. This link doesn’t work for me: https://pinkhq.com/jhome/index.php/download.
So, that’s the only way to get pink binary?
Hmm, yes, time is going on. Its difficult to get pink. I think I have to correct my notes!
Here is a still functioning link for download Pinkimage - Browse Files at SourceForge.net
or from Couprie himself http://www.esiee.fr/~coupriem/pink.tgz
For docs this one is helpful Pink: Main Page
I think the sourceforge code is well out-of-date. From the www.esiee.fr
archive
Using (k)ubuntu 18.04 and gmic_gimp_qt 2.9 I can get PINK working, but it is a comparatively big overhead for a couple of filters, 527 files / 135 MB
Looks like this: Pink Operator / Pink Operator Binary give a result. Pink Test Operator Bianca,‘times-out’ straight away, no other message.
edit: not quite true. A pre-view error message
apply gives this *** Error in ./fx_karo_pink_bianca/pink/pink_new/_xpinks/
*repeat/*local/_xpink/*if/ *** Exec status Is 256.
re. gmic_gimp_qt Have you changed the code last few days? The compiled binary (static) here, (Gimp 2.10 / 'buntu 18.04 / qt 5.9.5), has shrunk from about 8 MB down to 6.6 MB (error messages gone during compilation ?) Seems to be working OK for my use but too many filters to check-out each one.
We have tried once to enable the -flto
flag when compiling, which activates link-time optimization, and actually decrease the executable size by a factor of approx. 15%.
But as far as I know, this was a test that didn’t succeed on all architectures, so we had to disable it by default. Maybe you could check if the ‘-flto’ flag appears when you compile the plug-in ? (it should not actually!).
Another explanation is that we converted the .gmic filter sources to UTF-8 instead of using HTML sequences, but I doubt this saves 1.4 MB ! (this only concerns some accentuated characters).
Otherwise, I don’t know
Ja, only for the pink examples in the gmic-gimp-plugin overhead is considerable. Still there are lots of things graph-oriented, 2d and 3d partially usable with gmic cli wrapper or still better by itself!
By the way, I have on MacOS 10.14.6 581 pink executables with 15MB! Possibly a linking thing?
Concerning fx_karo_pink_bianca: under MaxOS Gimp 2.10.14 it works as expected (again), under Gimp 2.10.18 there is this immediate timeout! Both with the same plugin build! Still no idea to fix.
I am still trying around with that pink example Bianca.
One thing I see, I cannot set timeout to 0 sec, 1 is minimum! And the appearing timeout is independent of time set.
And it works in the older gimp version, the same plugin build.
I have tried to replace pink calls resulting in integer images (label) without success.
By the way in the pink bundle of applications there are real jewels! Look at label, which allows to select regions with several different options!
@KaRo, I have a question : does this timeout problem happen only with filters that does a call to PINK binaries, or does it happen also for other filters (e.g. Smooth [patch-based]
) ?
I have not tried much, still it happened (immediate timeout, set 60s) at least in
Testing->Reptorian->Autofill Coloring Book
Testing->Reptorian->Channel Overblur-Overlin-…
Repair->Unpurple
I tried it with a grayscale image, eg follic. Eventually generate a file with (gmic follic o follic.pgm)
With rgb image.jpg only 2nd Reptorian produces immediate timeout!
There are also some
Joan Rake->Degradation->Fake JFIF (JPEG) Encoder
Joan Rake->Degradation->JFIF Effects
To show some pink capability, here is a one-liner example to segment nuclei and to break connections, mostly done with pink routines. The result is sorted by size of nuclei and numbered sequentially.
rm follic +karo_threshold. , negate. +pink. closeball,2 pink. distc,0 n. 0,255 round. pink. wshedtopo,8,i pink. label,4,max neq. 0 mul[1,-1] pink. label,4,pla karo_label_sort. f. if(i==0,iM+1,i) n. 0,255
Seemingly pink executables are not the reason for problems with my pink bianca example, which in fact can be used to detect bacteria in microscopic multi-fluorescence images.
Hi David, the latest build a couple of minutes ago showed some differences:
/Users/karo $ gmic apply_timeout "repeat 10000 follic rm done",1
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Apply command ‘repeat 10000 follic rm done’ on image , with a timeout of 1 seconds.
[gmic] *** Error in ./apply_timeout/*if/*local/ *** G’MIC encountered a fatal error (images (0) and images names (1) have different size). Please submit a bug report, at: https://github.com/dtschump/gmic/issues
/Users/karo $ gmic 0 apply_timeout "repeat 10000 follic rm done",1
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Input empty image at position 0 (1 image 0x0x0x0).
[gmic]-1./ Apply command ‘repeat 10000 follic rm done’ on image [0], with a timeout of 1 seconds.
[gmic] *** Error in ./ *** Command ‘apply_timeout’: *** Error in ./apply_timeout/*if/*local/ *** *** Error in ./apply_timeout/*if/*local/*thread1/*do/ *** G’MIC encountered a fatal error (images (1) and images names (0) have different size). Please submit a bug report, at: https://github.com/dtschump/gmic/issues
Now, an image, poss. empty, don’t change anything. Now there is in both cases a fatal error!
Seemingly you have changed a critical thing!
Still, with selected image, no error!
gmic 0 apply_timeout[0] "repeat 10000 follic rm done",1
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Input empty image at position 0 (1 image 0x0x0x0).
[gmic]-1./ Apply command ‘repeat 10000 follic rm done’ on image [0], with a timeout of 1 seconds.
[gmic] *** Error in ./ *** Command ‘apply_timeout’: Time out (1 seconds) for command ‘repeat 10000 follic rm done’.
Haa excellent news! I’ve been able to reproduce the bug here on my machine !
$ gmic apply_timeout \"repeat 10000 follic rm done\",1
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Apply command 'repeat 10000 follic rm done' on image [], with a timeout of 1 seconds.
[gmic] *** Error in ./apply_timeout/*if#18305/*local#18311/ (file '/home/dtschump/work/src/gmic/src/gmic_stdlib.gmic', line #18318) *** G'MIC encountered a fatal error (images (0) and images names (1) have different size). Please submit a bug report, at: https://github.com/dtschump/gmic/issues
At least, I’ll be able to debug it here. What a relief!
I’ll keep you informed on this issue
Bug simplified:
$ gmic +store foo \$foo
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Store image [] as variable 'foo'
[gmic]-0./ Input image from variable 'foo', at position 0. (1 image 1x4x1x1).
[gmic]-1./ *** Error *** Internal error: Images (0) and images names (1) have different size, at return point.
There is apparently an issue with store
when the image selection is empty. I guess this will be easily fixable.
Interesting, just the difference between image and no-image! What that rarely used empty image in the example does!
I’ve just pushed a fix on the develop
branch of the git repo:
https://github.com/dtschump/gmic/commit/f8b228e42c7dbb75ff4d6e54f09192c32e2788de
Could you try on Mac and tell me is that also fixes your issues (as well as your other timeout issues ? Not sure why it should be related, but let’s hope ).
Step by step:
On cli behavior has just exchanged:
/Users/karo $ gmic m .config/gmic/update290.gmic apply_timeout “repeat 10000 follic rm done”,1
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Import commands from file ‘.config/gmic/update290.gmic’ (4119 replaced, total: 4219).
[gmic]-0./ Apply command ‘repeat 10000 follic rm done’ on image [], with a timeout of 1 seconds.
[gmic] *** Error in ./ (file ‘.config/gmic/update290.gmic’, line #32940) *** Command ‘apply_timeout’: Time out (1 seconds) for command ‘repeat 10000 follic rm done’.
/Users/karo $ gmic m .config/gmic/update290.gmic 0 apply_timeout “repeat 10000 follic rm done”,1
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Import commands from file ‘.config/gmic/update290.gmic’ (4119 replaced, total: 4219).
[gmic]-0./ Input empty image at position 0 (1 image 0x0x0x0).
[gmic]-1./ Apply command ‘repeat 10000 follic rm done’ on image [0], with a timeout of 1 seconds.
[gmic] *** Error in ./ (file ‘.config/gmic/update290.gmic’, line #32941) *** Command ‘apply_timeout’: *** Error in ./apply_timeout/*if#32928/*local#32934/ (file ‘.config/gmic/update290.gmic’, line #32937) *** *** Error in ./apply_timeout/*if#32928/*local#32934/*thread1/*do/*if/ (file ‘.config/gmic/update290.gmic’, call from line #32937) *** G’MIC encountered a fatal error (images (1) and images names (0) have different size). Please submit a bug report, at: Issues · dtschump/gmic · GitHub
With Gimp 2.10.18
No change with timeouts. Tried only with rgb tiger image.jpg. Pink … Bianca, Joan Rake as well as the second Reptorian.
With Gimp 2.10.14
As earlier Pink … Bianca works with the same plugin build. The other mentioned timeouts persist.
Latest findings with cli:
Sometimes the fatal error appears, sometimes not! I tried with “0” empty image as well as “follic” before apply_timeout. No irritation, kgmic is an alias to my latest local build of cli
/Users/karo $ kgmic 0 apply_timeout “repeat 10000 follic rm done”,1
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Input empty image at position 0 (1 image 0x0x0x0).
[gmic]-1./ Apply command ‘repeat 10000 follic rm done’ on image [0], with a timeout of 1 seconds.
[gmic] *** Error in ./ *** Command ‘apply_timeout’: Time out (1 seconds) for command ‘repeat 10000 follic rm done’.
/Users/karo $ kgmic apply_timeout “repeat 10000 follic rm done”,1
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Apply command ‘repeat 10000 follic rm done’ on image [], with a timeout of 1 seconds.
[gmic] *** Error in ./ *** Command ‘apply_timeout’: Time out (1 seconds) for command ‘repeat 10000 follic rm done’.
/Users/karo $ kgmic follic apply_timeout “repeat 10000 follic rm done”,1
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./follic/ Load thyroid follicle nuclei example image from local storage
[gmic]-1./ Apply command ‘repeat 10000 follic rm done’ on image [0], with a timeout of 1 seconds.
[gmic] *** Error in ./ *** Command ‘apply_timeout’: *** Error in ./apply_timeout/*if/*local/ *** *** Error in ./apply_timeout/*if/*local/*thread1/*do/*if/ *** G’MIC encountered a fatal error (images (1) and images names (0) have different size). Please submit a bug report, at: Issues · dtschump/gmic · GitHub
I have the impression that there is a variable not initialized!
Hum, both are working for me now.
What happens if you replace line 18317 of gmic_stdlib.gmic:
rm $initial
by
rm
or by
(remove it).
??
Only “rm” don’t change anything. Occasionally appears the fatal error, especially after changing image name length, 0, follic, osteo etc, but really not just understandable for me!
Commenting the line “rm $Initial” leads to a more frequent occurrence of fatal error. Changing between empty image list and anything (0,…) let appear fatal error more.
I could again build gmic with debug, still I need some commands for lldb! ?
By the way I changed that line in update290.gmic!
Five time the same command with image.jpg throws two errors!