Bug 343841 - Various G'Mic filters fail in preview mode
Summary: Various G'Mic filters fail in preview mode
Status: RESOLVED DUPLICATE of bug 344569
Alias: None
Product: krita
Classification: Applications
Component: G'Mic for Krita (other bugs)
Version First Reported In: 2.9 Beta
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: LukasT
URL:
Keywords:
: 343799 345167 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-02-06 00:15 UTC by williamK
Modified: 2015-03-15 11:21 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
screen snapshots of message boxes (452.58 KB, image/png)
2015-02-06 00:20 UTC, williamK
Details

Note You need to log in before you can comment on or make changes to this bug.
Description williamK 2015-02-06 00:15:08 UTC
Trying to duplicate krita crashes that may have been due to G'Mic, I tried to take a simple 2 layer file with a scribble on it and run through each, hoping to find the precipitant filter.  I was not able to crash krita (although I cancelled it myself on a Fractal filter which seemed to be going on and on even though the preview was instant).  The attached files document the errors, many of which look very similar so hopefully most in once place.

Reproducible: Always

Steps to Reproduce:
1.  Start with doodle
2.  Select filter and see what happens.
3.

Actual Results:  
message box with G'Mic preview failed.

Expected Results:  
Preview

Windows 8.1 w/current maintenance.  SP3

Looks like I have to attach files in a followup.
Comment 1 williamK 2015-02-06 00:20:08 UTC
Created attachment 90934 [details]
screen snapshots of message boxes
Comment 2 Halla Rempt 2015-02-06 09:17:10 UTC
Hi William, 

Maybe these are filters that we should blacklist -- the errors come from g'mic itself. Lukas, what do you think?
Comment 3 Halla Rempt 2015-02-06 10:03:41 UTC
*** Bug 343799 has been marked as a duplicate of this bug. ***
Comment 4 Halla Rempt 2015-02-06 12:38:20 UTC
On Linux I have this:

Give an error box:

ascii art
montage

Give a crash warning

Cartesian transform
Polar transform 
Visible Watermark
Blend (fade)
Quick copyright
Fourier watermark
Import Data
Comment 5 LukasT 2015-02-11 21:36:52 UTC
I have fixed ascii art and montage locally, patch will be commited soon. I will investigate the rest of the filters
Comment 6 Silvio Grosso 2015-02-12 20:37:24 UTC
Krita 2.9 beta 3 (downloaded today)
Windows 7 - 64 bit 

Tested also on Kubuntu 14.10 - Krita 2.9 beta 2

The filter Artistic Rodilus crashes both on Windows and Kubuntu 14.10
On Kubuntu it is much more difficult to crash (Krita 2.9 beta 2) but in the end you get there as well :-)
You only need to move fast the sliders (Amplitude etc) and G'MIC always crashed in the end

Here is the backtrace for Kubuntu 14.10:
https://dl.dropboxusercontent.com/u/3095134/BUGS_REPORT/GDB_CRASH_RODILUS

Here is the video for more information on Kubuntu (beta 2 for Krita):
https://dl.dropboxusercontent.com/u/3095134/BUGS_REPORT/GMIC_KRITA_RODILUS_CRASH.avi
Comment 7 Silvio Grosso 2015-02-12 21:22:57 UTC
Windows 7 - 64 bit
Krita 2.9 beta 3

The filter Circle abstraction (Artistic Menu) does not work on Windows.

Here is the screenshot on Windows 7:
https://dl.dropboxusercontent.com/u/3095134/BUGS_REPORT/GMIC_CIRCLE_ABSTRACTION_BUG.png

On the contrary it works fine on Kubuntu 14.10 with Krita 2.9 beta 2 (ppa by Dmitry).
I have tried over and over to crash this G'MIC filter (Circle abstracion) on Linux to no avail :-)
Comment 8 Silvio Grosso 2015-02-12 22:00:01 UTC
Windows 7 - 64 bit
Krita 2.9 (beta 3)

Wind filter does not work OR crashes Krita on Windows 7
In short, the filter: Deformations > WIND behaves wildly :-)

On Windows 7 most of the time it does not produce any effect.
Sometimes, not always, it even  crashes Krita 2.9 (beta 3) and I have to restart it  !

I have tested this filter (Wind) on Kubuntu 14.10 as well:
- the preview works fine: the effect is correct BUT when you click on apply or Ok the filter is not applied on the real image in the end.
- Sometimes this filter (wind) even crashes Krita on Kubuntu (beta 2).

Here is the backtrace for the crash on Linux:
https://dl.dropboxusercontent.com/u/3095134/BUGS_REPORT/GMIC_WIND_DEFORMATIONS_CRASH.txt

BTW, I have tested the wind filter on Gimp (Windows 7 - G'MIC 1.6.0.3) and it works fine there (no crash whatsoever).
Comment 9 Silvio Grosso 2015-02-12 22:23:44 UTC
here are other 3 filters (Blu linear, Dirty, Add Grain) which do no work on Windows 7 - Krita beta 3

Windows 7 - 64 bit (Krita 2.9 - beta 3):
DEGRADATIONS > BLU LINEAR (does not work > window pops us with error)
Kubuntu 14.10 - krita beta 2 works fine instead.

Windows 7 - 64 bit (Krita 2.9 - beta 3):
degradatsions > DIRTY  (does not work > window pops up with error)
Kubuntu 14.10 - krita beta 2 works fine instead.

Windows 7 - 64 bit (Krita 2.9 - beta 3):
FILM EMULATION > ADD GRAIN (does not work > window pops up with error)
Here is the screenshot on Windows: 
https://dl.dropboxusercontent.com/u/3095134/BUGS_REPORT/GMIC_FILM_EMULATION_BUG.png
Kubuntu 14.01 - Krita beta 2 works fine instead.
Comment 10 Silvio Grosso 2015-02-12 22:55:14 UTC
All these 8 filters work fine on Linux - Kubuntu 14.10 (Krita 2.9 - beta 2)
On the contrary, they do not work on Windows 7 - 64 bit (Krita 2.9 - beta 3):

BURN (ligths and shadows): window pops up with error
MAKE SEAMLESS (patterns): window pops up with error
RESYTHETIZE TEXTURE (patterns): window pops up with error
SHOCK WAVES (patterns):  window pops up with error
UPSCALE (DIFFUSION): window pops up with error
RODILUS (ANIMATED): window pops up with error
BANDPASS (special filters): window pops up with error
FOURIER TRANSFORM (special filters): window pops up with error

P.S: Tonight, I have tried all the previews for the G'MIC filters on Windows 7 for Krita 2.9 - beta 3 :-)
Comment 11 LukasT 2015-02-14 19:11:06 UTC
Git commit 1135aea69d52038515db5ebc8c8b29529a62ee13 by Lukáš Tvrdý.
Committed on 14/02/2015 at 19:06.
Pushed by lukast into branch 'calligra/2.9'.

Implement _none_ command

"Use '_none_' as a special command or preview_command
to tell the plug-in that the entry requires no G'MIC call"

Fixes filters with _none_, e.g. Fourier watermark

M  +12   -0    krita/plugins/extensions/gmic/kis_gmic_plugin.cpp

http://commits.kde.org/calligra/1135aea69d52038515db5ebc8c8b29529a62ee13
Comment 12 LukasT 2015-02-14 19:11:07 UTC
Git commit 25a9e51c65c86c7f7a5a960cd0671bb256ef7904 by Lukáš Tvrdý.
Committed on 14/02/2015 at 19:08.
Pushed by lukast into branch 'calligra/2.9'.

Remove working filters from blacklist

Cartesian transform
Polar transform
Visible Watermark
Blend (fade)
Quick copyright
Fourier watermark
Import Data

Problems were fixed in 17f4d0913becbdb3130c9d37ed7016ac2a51be85
All filters except "Import Data" have parser unit-tests passing!

M  +0    -22   krita/plugins/extensions/gmic/gmic_def.gmic.blacklist

http://commits.kde.org/calligra/25a9e51c65c86c7f7a5a960cd0671bb256ef7904
Comment 13 LukasT 2015-02-14 19:25:46 UTC
Artistic / Rodilius was probably fixed by 
b45aad5cf5a568cf3c09f3a026ea960ee8ef580b or 
f78e6dd9f5408eb1ff09a8e2c4748a82d946a7e9 or
b7376127f711a037fef6b097e0d890aee5dd926a 

I still have to implement proper compressing of the preview requests for small preview.
Comment 14 LukasT 2015-02-14 19:28:51 UTC
 Circle abstraction (Artistic Menu)  works for me, but I also reproduced the dialog error in G'MIC for GIMP (without updates of filter definitions: I removed ~/.update1603.gmic file)

For the dialog error see bug 343880 and this attachment
https://bugs.kde.org/attachment.cgi?id=91075
Comment 15 LukasT 2015-02-14 19:37:04 UTC
Git commit 96445265572f6eae3861756417c6b996ef015483 by Lukáš Tvrdý.
Committed on 14/02/2015 at 19:36.
Pushed by lukast into branch 'calligra/2.9'.

Add test case for filter Wind

Parser works correctly

M  +3    -0    krita/plugins/extensions/gmic/tests/data/filterCommands.txt

http://commits.kde.org/calligra/96445265572f6eae3861756417c6b996ef015483
Comment 16 LukasT 2015-02-14 19:41:04 UTC
Wind filter has the same problem as Artistic Rodilus

See the part of the backtrace:
at /build/buildd/krita-testing-2+git20150202+r73774-51/krita/plugins/extensions/gmic/kis_gmic_small_applicator.cpp:83

I suppose it is again about proper compressing of the preview requests for small preview.
To workaround it: do not move very fast with the sliders :D but if it still happens, let us know.
Comment 17 LukasT 2015-02-14 20:08:07 UTC
Git commit 6d2aeed23f16dae2397d72f76677f470051e6b70 by Lukáš Tvrdý.
Committed on 14/02/2015 at 20:05.
Pushed by lukast into branch 'calligra/2.9'.

Add unit-test for parser for filters Blur [linear], Dirty and Add grain

Parsing all filters works correctly (since 96445265572f6eae3861756417c6b996ef015483)

M  +13   -0    krita/plugins/extensions/gmic/tests/data/filterCommands.txt

http://commits.kde.org/calligra/6d2aeed23f16dae2397d72f76677f470051e6b70
Comment 18 LukasT 2015-02-14 20:24:24 UTC
> FILM EMULATION > ADD GRAIN (does not work > window pops up with error)
>Here is the screenshot on Windows: 
>https://dl.dropboxusercontent.com/u/3095134/BUGS_REPORT/GMIC_FILM_EMULATION_BUG.png

Maybe Windows version of GMIC is not compiled with zlib, zlib is required to support cimgz files.

Silvio, could you share also the other  "window pops up with error" errors? :) 
Thanks!
Comment 19 LukasT 2015-02-14 20:50:21 UTC
Git commit 1c71bada412387f685189c6c260f85b4b5af10b8 by Lukáš Tvrdý.
Committed on 14/02/2015 at 20:46.
Pushed by lukast into branch 'calligra/2.9'.

Add more filters to parser unit test

Make sure that this list of filters does not have problems
with parsing its definitions in *.def file

BURN (ligths and shadows): window pops up with error
MAKE SEAMLESS (patterns): window pops up with error
RESYTHETIZE TEXTURE (patterns): window pops up with error
SHOCK WAVES (patterns):  window pops up with error
UPSCALE (DIFFUSION): window pops up with error
RODILUS (ANIMATED): window pops up with error
BANDPASS (special filters): window pops up with error
FOURIER TRANSFORM (special filters): window pops up with error

M  +31   -0    krita/plugins/extensions/gmic/tests/data/filterCommands.txt

http://commits.kde.org/calligra/1c71bada412387f685189c6c260f85b4b5af10b8
Comment 20 LukasT 2015-02-14 20:52:13 UTC
So to conclude: 
* we need info about the error messages 
* we need info about windows build : is it compiled with zlib enabled?

boud: can you check in CMakeLists.txt in gmic folder if ZLIB_FOUND is set correctly?
Comment 21 Silvio Grosso 2015-02-14 21:28:28 UTC
Hi Lukas,

Thaks a lot for your help ;-)

Here is the link to download a folder with all my screenshots (taken with Krita 2.9 - beta 3 installed on Windows 7 - 64 bit):
https://dl.dropboxusercontent.com/u/3095134/BUGS_REPORT/GMIC_ERROR_PREVIEW_WINDOWS-7-64-BIT.zip

P.s: the G'MIC upscale diffusion filter works on Windows now (no message error pops up)
Comment 22 LukasT 2015-02-16 07:55:59 UTC
For Burn (lights and shadows) I got:

Sorry! G'Mic failed, reason:*** Error in ./gimp_burn_preview/gimp_split_preview/../*local/fftpolar/*repeat/*local/ *** Command '-fft': gmicList<float>::FFT(): Specified real and imaginary parts (195,146,1,1) have non 2^N dimension along the Y-axis.

For MAKE SEAMLESS (patterns):
Sorry! G'Mic failed, reason:*** Error in ./gimp_make_seamless_preview/gimp_split_preview/../*repeat/*local/*repeat/*local/ *** Command '-fft': gmicList<float>::FFT(): Specified real and imaginary parts (195,146,1,1) have non 2^N dimension along the Y-axis.

Almost every filter that Silvio mentions in https://bugs.kde.org/show_bug.cgi?id=343841#c10 is about FFTW3

UPSCALE (DIFFUSION): window pops up with error
I got black small preview here 

It seems we try to run filters that require FFTW3 and we maybe don't have that dependency on Windows.
Comment 23 LukasT 2015-02-17 07:57:56 UTC
Regarding the problem with add grain: https://bugs.kde.org/show_bug.cgi?id=343841#c9

G'mic needs to see curl.exe somewhere on Windows, and we don't set some path where curl.exe is, so it can't download gmic_grain_orwo_np20.cimgz 

You can use G'Mic for gimp (it downloads the file for you) or download the file manually and that one will download the cimgz file to this folder:
c:\Users\[your-username]\AppData\Roaming\gmic_grain_orwo_np20.cimgz

Then the filter add grain will fail with FFT error message.
Comment 24 Halla Rempt 2015-02-17 07:59:01 UTC
I don't think curl is available by default on Windows... We could package it, but fftw3 is a really problematic dependency on Windows, too.
Comment 25 LukasT 2015-02-21 16:45:35 UTC
Git commit cbfbde4cfcb8865fe58e2b19803b7385d4692c27 by Lukáš Tvrdý.
Committed on 21/02/2015 at 16:38.
Pushed by lukast into branch 'calligra/2.9'.

Update g'mic to 1.6.1.0 beta

Changelog for 1.6.0.4 : https://www.flickr.com/groups/gmic/discuss/72157649713920459/
Changelog for 1.6.1.0 : https://www.flickr.com/groups/gmic/discuss/72157650442201289/

* fix tests, some filters were changed/moved/renamed
* apply fixx11 header fix

This G'Mic release solves the problems on Windows with downloading
files for filters like Add grain: it uses proper library libcurl
for downloading files.

M  +480  -386  krita/plugins/extensions/gmic/src/CImg.h
M  +640  -631  krita/plugins/extensions/gmic/src/gmic.cpp
M  +20   -4    krita/plugins/extensions/gmic/src/gmic.h
M  +2076 -1404 krita/plugins/extensions/gmic/src/gmic_def.gmic
M  +198442 -194518 krita/plugins/extensions/gmic/src/gmic_def.h
M  +1    -1    krita/plugins/extensions/gmic/tests/data/filterCommands.txt
A  +1035 -0    krita/plugins/extensions/gmic/tests/data/gmic_def_1610_krita.xml
M  +9    -6    krita/plugins/extensions/gmic/tests/kis_gmic_tests.cpp
M  +1    -0    krita/plugins/extensions/gmic/tests/kis_gmic_tests.h

http://commits.kde.org/calligra/cbfbde4cfcb8865fe58e2b19803b7385d4692c27
Comment 26 LukasT 2015-02-21 16:47:45 UTC
Ok, now it is a matter of dependencies. We need libcurl and FFTW on Windows and filters will work!
Comment 27 Halla Rempt 2015-03-15 11:20:56 UTC
*** Bug 345167 has been marked as a duplicate of this bug. ***
Comment 28 Halla Rempt 2015-03-15 11:21:46 UTC

*** This bug has been marked as a duplicate of bug 344569 ***