Bug 422996 - Digikam Crash with GMicQt plugin on Mac Mojave
Summary: Digikam Crash with GMicQt plugin on Mac Mojave
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Editor-GmicQt (show other bugs)
Version: 7.5.0
Platform: macOS (DMG) macOS
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-15 00:46 UTC by Geoff King
Modified: 2023-03-31 17:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0
Sentry Crash Report:


Attachments
preview error example 1 (577.58 KB, image/png)
2021-01-02 17:32 UTC, Geoff King
Details
crash log (9.20 KB, text/plain)
2021-01-07 02:29 UTC, Geoff King
Details
lldb log and terminal output for crash from gmic (10.54 KB, text/plain)
2021-01-15 16:04 UTC, Geoff King
Details
additional crash info from showfoto. (4.71 KB, text/plain)
2021-01-15 19:25 UTC, Geoff King
Details
attachment-1677493-0.html (1.72 KB, text/html)
2023-03-26 22:01 UTC, Geoff King
Details
git rebase instruction 1 (530.12 KB, image/png)
2023-03-30 03:27 UTC, caulier.gilles
Details
git rebase instruction 2 (159.71 KB, image/png)
2023-03-30 03:27 UTC, caulier.gilles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff King 2020-06-15 00:46:01 UTC
I am getting repeatable crashes when using the G'Mic plugin with Digikam 7.0 rc on Mac Mojave.  
This is with the digikam debug version from 20200614.  
Editor Open.  
Opened G'MIC-QT.  
Took a few tries of opening and closing things, but eventually crashed again.
Seemed repeatable with the Film Simulation. 
I have not tried other OS, as I'm mostly a Mac user. 


Process 14270 stopped
* thread #51, name = 'FilterThread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1624a558c)
    frame #0: 0x0000000125a0b52e Editor_GmicQt_Plugin.so`gmic::add_commands(char const*, char const*, unsigned int*, unsigned int*, bool*) + 5630
Editor_GmicQt_Plugin.so`gmic::add_commands:
->  0x125a0b52e <+5630>: movb   (%r13), %al
    0x125a0b532 <+5634>: testb  %al, %al
    0x125a0b534 <+5636>: jne    0x125a0b2e0               ; <+5040>
    0x125a0b53a <+5642>: movq   -0x80(%rbp), %r12
Target 0: (digikam) stopped.
(lldb) bt
* thread #51, name = 'FilterThread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1624a558c)
  * frame #0: 0x0000000125a0b52e Editor_GmicQt_Plugin.so`gmic::add_commands(char const*, char const*, unsigned int*, unsigned int*, bool*) + 5630
    frame #1: 0x00000001259feb76 Editor_GmicQt_Plugin.so`void gmic::_gmic<float>(char const*, cimg_library::CImgList<float>&, cimg_library::CImgList<char>&, char const*, bool, float*, bool*) + 1782
    frame #2: 0x0000000125a0ee91 Editor_GmicQt_Plugin.so`gmic::gmic<float>(char const*, char const*, bool, float*, bool*, float const&) + 673
    frame #3: 0x00000001259941d1 Editor_GmicQt_Plugin.so`FilterThread::run() + 449
    frame #4: 0x0000000104fa8ad4 QtCore`___lldb_unnamed_symbol473$$QtCore + 248
    frame #5: 0x00007fff6773b2eb libsystem_pthread.dylib`_pthread_body + 126
    frame #6: 0x00007fff6773e249 libsystem_pthread.dylib`_pthread_start + 66
    frame #7: 0x00007fff6773a40d libsystem_pthread.dylib`thread_start + 13
(lldb)
Comment 1 caulier.gilles 2020-06-15 09:43:35 UTC
Which MacOS version did you use exactly ?

This can is reproducible with 7.0.0-beta1, 2, or 3 ? I updated GMic-qt recently...

Gilles Caulier
Comment 2 Geoff King 2020-06-15 12:50:15 UTC
This is for Mac 10.14.6. 
I have tried one or two of the earlier versions in the last month or so and they also exhibited this issue.  I'm not sure about earlier betas.
Comment 3 caulier.gilles 2020-06-15 15:54:48 UTC
Hi Geoff,

Looking your backtrace, it look like an internal crash in Gimc library.

Remember that MacOS support with GMic Qt is not official. It compile, but i doudt that run time is checked for this OS. Look this comment about the Gimp plugin version:

https://gmic.eu/download.shtml

"MacOS: We do not officially maintain a MacOS build of G'MIC. We are aware that some people have successfully built the G'MIC-Qt plug-in for GIMP. You may find useful resources here and here (use at your own risk!). "

Q : can you try to reproduce the dysfunction with Gimp/MacOS Gmic plugin ?

Gilles Caulier
Comment 4 Geoff King 2020-06-15 23:36:08 UTC
Hello, 
I am successfully using the G'MIC-Qt plug-in for GIMP.  It is an older version (2.7.3_pre#190929) on 2.10.14. It runs normally with no crashes after several tries today.  
Thanks, Geoff
Comment 5 David Tschumperlé 2020-07-30 08:06:44 UTC
Maybe a useful note about G'MIC on MacOSX : 
A few years ago, when trying to make G'MIC work on MacOSX (but the CLI tool, not the G'MIC-Qt plug-in), we experienced a lot of random crashes, happening when new threads were created by the G'MIC interpreter (it looked similar to what your log shows).

The reason was that the default stack size allocated when creating a new thread on MacOSX is ridiculously low (512Kb, while it's several MB on Windows/Linux), and thus, the G'MIC interpreter (which is a pretty complex function) was running out of stack memory.
We added a work-around in the G'MIC interpreter code, specifically to solve this for MacOSX, file 'gmic.cpp', l.10324 : https://github.com/dtschump/gmic/blob/master/src/gmic.cpp#L10324

Anyway, I'm not sure we did the same for the threads created by the G'MIC-Qt plug-in, and in that case, it would mean that the main G'MIC instance is run with a 512Kb stack (as it's run in a thread created by G'MIC-Qt).

Maybe something to investigate.
Comment 6 David Tschumperlé 2020-07-30 08:10:21 UTC
After checking, it seems we already have taken care of it : https://github.com/c-koi/gmic-qt/blob/master/src/FilterThread.cpp#L44
But maybe the condition `#ifdef _IS_MACOS_` does not hold ?

We cannot check here, as we don't have a machine with MacOSX.
Comment 7 caulier.gilles 2020-07-30 09:20:50 UTC
Thanks David. I use a Macbook pro here, so i will check this pre-processor condition. 

It's interesting to see the huge limitation of stack under OSX. I know that we needs to fix in the pass all local class allocations in function with new operator to prevent memory allocation error (using LibRaw class in digiKam for ex.). 

Best

Gilles Caulier
Comment 8 Geoff King 2020-08-02 15:06:12 UTC
Hello. Tested on macOS Catalina 10.15.6 and Digikam 7.0.0.
I tried G'Mic on a few files,   I did a few tries, and went for about 10 minutes clicking through different filters and changing settings.  

However, I did get several crashes eventually, which seem to be more prevalent with some of the filters in the Color category, such as Abstraction and CMYK Tone.   
The crashes happened when selecting the filter. 
Thanks.
Comment 9 caulier.gilles 2020-12-18 10:12:33 UTC
Hi,

A new version of digiKam 7.2.0-beta2 PKG installer for MacOS compatible with HighSierra to BigSur is available for testing here :

https://files.kde.org/digikam/

This PKG include a more recent version of GMicQt plugin (2.92), including a up-to-date GMic + CImg codes

Can you take a look if plugin work better now ? Thanks in advance

Gilles Caulier
Comment 10 Geoff King 2020-12-19 17:30:22 UTC
Unfortunately GMicQT crashes more often than before.  The dialog will open, and I can usually select a filter and change some settings.  However, it usually crashes when clicking Apply.  

This is on Catalina 10.5.7 and digiKam-7.2.0-beta2-20201219T112949-MacOS-x86-64

Thanks, Geoff
Comment 11 caulier.gilles 2021-01-01 23:06:58 UTC
Hi all, and happy new year

With this commit from my personal clone of GMicQt, i add macOS debug symbols rules to be able to catch traces in debugger when plugin crash under macOS:

https://github.com/cgilles/gmic-qt/commit/cf9135964e91fbedb60731b341ddb56298fe35e2

This clone on github is included to whole digiKam macOS bundle.

To David Tschumperlé: feel free to backport this commit to official GMicQt repository.

Gilles Caulier
Comment 12 Geoff King 2021-01-02 17:32:01 UTC
Created attachment 134478 [details]
preview error example 1

I am getting lots of messages like this on various filters.  This one was triggered by moving the brightness slider.
Comment 13 caulier.gilles 2021-01-02 17:38:20 UTC
Hi Geoff,

Do you seen the same dysfunction under Linux version ?

Happy new year

Gilles
Comment 14 Geoff King 2021-01-02 18:18:36 UTC
Hi, 
I do not see these filter errors on Ubuntu.  It seems fine in some short testing.
Also this Mac version seems to be noticeable slower to changes to the sliders or applying the effect when compared with a significantly lower spec Ubuntu machine I'm using for comparison.  

On the Mac, I did just get a crash,  when clicking through filters.  This was the Artistic > Cartoon filter after clicking the refresh button in the top right corner. I was also getting a "preview error:"  in the preview pane which I didn't take a screenshot of.  


Process 37099 stopped
* thread #58, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000013861b2d2 Editor_GmicQt_Plugin.so`gmic& gmic::_run<float>(cimg_library::CImgList<char> const&, unsigned int&, cimg_library::CImgList<float>&, cimg_library::CImgList<char>&, cimg_library::CImgList<float>&, cimg_library::CImgList<char>&, unsigned int const*, bool*, char const*, cimg_library::CImg<unsigned int> const*) + 194
Editor_GmicQt_Plugin.so`gmic::_run<float>:
->  0x13861b2d2 <+194>: cmpq   %rcx, (%rax)
    0x13861b2d5 <+197>: jne    0x13861b2e8               ; <+216>
    0x13861b2d7 <+199>: movq   -0x108(%rbp), %rcx
    0x13861b2de <+206>: cmpq   %rcx, 0x8(%rax)
Target 0: (digikam) stopped.
(lldb) bt
* thread #58, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x000000013861b2d2 Editor_GmicQt_Plugin.so`gmic& gmic::_run<float>(cimg_library::CImgList<char> const&, unsigned int&, cimg_library::CImgList<float>&, cimg_library::CImgList<char>&, cimg_library::CImgList<float>&, cimg_library::CImgList<char>&, unsigned int const*, bool*, char const*, cimg_library::CImg<unsigned int> const*) + 194
    frame #1: 0x0000000138772643 Editor_GmicQt_Plugin.so`void* gmic_parallel<float>(void*) + 115
    frame #2: 0x00007fff6faf0109 libsystem_pthread.dylib`_pthread_start + 148
    frame #3: 0x00007fff6faebb8b libsystem_pthread.dylib`thread_start + 15
Comment 15 caulier.gilles 2021-01-02 21:56:40 UTC
Git commit f91750b4b88581047aa0de7e00b22ff8f091f248 by Gilles Caulier.
Committed on 02/01/2021 at 21:45.
Pushed by cgilles into branch 'master'.

Missing to copy debug symbols dir for GmicQt plugin. This directory is not installed with cmake.
CCBUGS: 422996

M  +3    -1    project/bundles/macports/03-build-digikam.sh

https://invent.kde.org/graphics/digikam/commit/f91750b4b88581047aa0de7e00b22ff8f091f248

diff --git a/project/bundles/macports/03-build-digikam.sh b/project/bundles/macports/03-build-digikam.sh
index e3c35cd38a..c936de92a4 100755
--- a/project/bundles/macports/03-build-digikam.sh
+++ b/project/bundles/macports/03-build-digikam.sh
@@ -3,7 +3,7 @@
 # Script to build digiKam using MacPorts
 # This script must be run as sudo
 #
-# Copyright (c) 2015-2020 by Gilles Caulier  <caulier dot gilles at gmail dot com>
+# Copyright (c) 2015-2021 by Gilles Caulier  <caulier dot gilles at gmail dot com>
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
@@ -182,6 +182,8 @@ cmake --build . --config RelWithDebInfo --target ext_gmic_qt    -- -j$CPU_CORES
 cmake --build . --config RelWithDebInfo --target ext_mosaicwall -- -j$CPU_CORES

 mv -f $INSTALL_PREFIX/libexec/qt5/plugins/digikam/editor/*.so $INSTALL_PREFIX/lib/plugins/digikam/editor/
+# Install GmicQt plugin debug symbols.
+cp $BUILDING_DIR/ext_gmicqt/ext_gmic_qt-prefix/src/ext_gmic_qt-build/Editor_GmicQt_Plugin.so.dSYM $INSTALL_PREFIX/lib/plugins/digikam/editor/ || true

 #################################################################################################
Comment 16 caulier.gilles 2021-01-03 12:53:55 UTC
Git commit eca031f86badcf648504feda8c51d40862e3dd84 by Gilles Caulier.
Committed on 03/01/2021 at 12:51.
Pushed by cgilles into branch 'master'.

copy recursively this debug directory

M  +1    -1    project/bundles/macports/03-build-digikam.sh

https://invent.kde.org/graphics/digikam/commit/eca031f86badcf648504feda8c51d40862e3dd84
Comment 17 Geoff King 2021-01-06 20:03:21 UTC
Do you need more feedback or crash reports from me?
Comment 18 caulier.gilles 2021-01-06 22:44:21 UTC
Hi Geoff, 

Yes a good help will be to use the "debug" PKG version available at usual place :

https://files.kde.org/digikam/digiKam-7.2.0-rc-20210106T161328-MacOS-x86-64-debug.pkg.mirrorlist

This one include debug symbols which will allow to get a debugger back-trace when crash occurs.

Gilles
Comment 19 Geoff King 2021-01-07 02:29:26 UTC
Created attachment 134629 [details]
crash log

BELOW HAD IMAGE IN EDITOR.  CLICKED THE G'MIC-QT EFFECT AND IT CRASHED IMMEDIATELY. 
THIS IS A CHANGE FROM LAST TIME I TRIED IT A FEW DAYS AGO WHERE IT WOULD USUALLY 
CRASH ONCE IN G'MIC AFTER A FEW CLICKS.
Comment 20 Geoff King 2021-01-12 21:59:02 UTC
Hello.  I see that there is a new gmic version out 2.9.4 that includes some bug fixes. Could you please update to that newer version to see if it helps the situation on Mac.  Currently it is crashing instantly upon starting the G'Mic effect. 

Thanks, Geoff
Comment 21 caulier.gilles 2021-01-12 22:02:50 UTC
yes, i will look for an update soon...
Gilles
Comment 22 Geoff King 2021-01-15 16:04:15 UTC
Created attachment 134899 [details]
lldb log and terminal output for crash from gmic

Including this since it is more recent, and I think I did the crash log correctly with more info, and the debug terminal output is also included and looks like it has useful info.
Comment 23 Geoff King 2021-01-15 19:25:30 UTC
Created attachment 134911 [details]
additional crash info from showfoto.

This bug was originally about digikam, but I may also have relevant info from showfoto.  Attached is a crash log from Showfoto. 
This is on Mac with digiKam-7.2.0-rc-20210115T054811-MacOS-x86-64-debug.  

I have a consistent crash in showfoto after using gmic.  
In the attached crash log, I had been playing with gmic just before, but had cleanly exited the editor and then closed showfoto.  
This happens consistently upon closing showfoto.  If I run gmic, then showfoto will crash later. showfoto does not normally crash if I do not use gmic. 

This is significantly different than digikam because, in showfoto you can still used gmic usually, at least for a few minute before it crashes.  However, in digikam it is crashing immediately for me now.
Comment 24 caulier.gilles 2021-03-30 06:53:37 UTC
digiKam 7.2.0 official release is published with more than 360 files closed from bugzilla:

https://www.digikam.org/news/2021-03-22-7.2.0_release_announcement/

Can you reproduce the dysfunction with this version ?

Thanks in advance for your feedback

Gilles Caulier
Comment 25 Geoff King 2021-04-11 22:49:18 UTC
Hello. Just an update.  
Still crashes immediately upon clicking gmic in digikam.  In Showfoto it can usually run for few minutes but after a bunch of clicks of different settings or filters it will usually crash.  
 
rocess:               digikam [15239]
Path:                  /Applications/digiKam.org/digikam.app/Contents/MacOS/digikam
Identifier:            digikam
Version:               7.2.0 (7.2.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           digikam [15239]
User ID:               501

Date/Time:             2021-04-11 18:39:31.672 -0400
OS Version:            Mac OS X 10.15.7 (19H524)
Report Version:        12
Comment 26 caulier.gilles 2021-04-12 03:36:00 UTC
Hi Geoff, 

Yes i still crash. I need to update my github meta repository to host GMic-qt code for digiKam plugin.

I seen Krita start to use a different way to host GMic-qt plugin too. The problem to host Gmic-qt tool as application plugin do not come from digiKam only. They wrap original source code from gmic-qt by plenty of patches...

https://invent.kde.org/graphics/krita/-/tree/master/3rdparty_plugins/ext_gmic

...and i don't yet found time to review the difference with my github meta repository. I want to be sure to understand all.

Best

Gilles Caulier
Comment 27 caulier.gilles 2021-12-28 05:32:31 UTC
Hi Geoff,

I tried Krita 5.0 for under BigSur (intel), and it crash too after few minutes. GmicQt is 3.0.

Happy new year

Gilles Caulier
Comment 28 caulier.gilles 2022-01-14 10:45:33 UTC
Hi,

If i look into Krita bugzilla i can see at least 2 bugs under MacOS :

https://bugs.kde.org/show_bug.cgi?id=351671
https://bugs.kde.org/show_bug.cgi?id=350965

And look the comment here :

https://bugs.kde.org/show_bug.cgi?id=350965#c5

It's clear, Gmic must support other compiler that GCC, as Clang. For me it's a UPSTREAM bug.

Best

Gilles
Comment 29 caulier.gilles 2022-07-29 06:28:35 UTC
Hi all,

GMicQt 3.1. will be available in next digiKam 7.8.0 :

https://i.imgur.com/8iji6Bo.png

Please, let's me hear if problem remain in daily pre-release bundles (will be updated in a few hours).

Best

Gilles Caulier
Comment 30 caulier.gilles 2023-03-11 21:18:41 UTC
*** Bug 467215 has been marked as a duplicate of this bug. ***
Comment 31 caulier.gilles 2023-03-12 13:24:03 UTC
DOWNSTREAM bug from GMICQt: https://github.com/c-koi/gmic-qt/issues/160
Comment 32 caulier.gilles 2023-03-17 06:56:19 UTC
Hi Geoff, 

As i can see on the DOWNSTREAM bug from gmic-qt, the problem is locate on the stack size under MacOS which is very small. all memory allocation on the stack done in gmic-qt algorithm will fill the capacity and crash violently.

With my last commit, I patched the gmic-qt build rules to increase the stack with the Clang compiler to override the default value.

https://github.com/cgilles/gmic-qt/commits/master

I will recompile digiKam and gmic-qt while this week end.  

Best

Gilles Caulier
Comment 33 caulier.gilles 2023-03-18 10:46:49 UTC
Git commit 8d86963ec06d56e9fb8e96df3c149abaf20a1c4b by Gilles Caulier.
Committed on 18/03/2023 at 10:44.
Pushed by cgilles into branch 'master'.

Increase stack size under Windows and MacOS to prevent crash with Gmic-qt
Related: bug 467215

M  +4    -0    core/CMakeLists.txt
A  +29   -0    core/cmake/rules/RulesMacOS.cmake
M  +14   -2    core/cmake/rules/RulesWindows.cmake

https://invent.kde.org/graphics/digikam/commit/8d86963ec06d56e9fb8e96df3c149abaf20a1c4b
Comment 34 Geoff King 2023-03-18 15:23:07 UTC
Hi, This is so much better.   Thank You.   I was able to use it and play with most filters now with no issues. 
The original report pointed to "Film Simulate" and that now works fine - no crashes after several processed photos with different settings. 
Also an earlier report pointed to "Artistic > Cartoon" and that now works fine also. 

I'm now using digiKam-8.0.0-20230318T115132-MacOS-x86-64.pkg on a MacBook Air 2022 12.6.3. 

However, I still did get a few repeatable crashes but they appear to be filter specific, for example, Colors > Mixer [LAB] or Color Temperature seems to always crash quickly when entering.  I can report those separately if you prefer. 
Should I make a new bug report here or somewhere else?

As it is now this is a big improvement and usable, if I stay away from a few specific filters.
Comment 35 caulier.gilles 2023-03-18 17:33:56 UTC
Hi Geof,

yesterday, the new gmic + gmicqt version 3.2.2 have been released. We are for now in 3.1.6. I will update all code before to conclude.

And yes, i see the improvements also in my computer, and also few crashes in specific filters.

I still few way to study for improvements :

- Use gcc instead clang as compiler. i remember a thread in gmic issue about the right compiler to use.
- libfftw under mac which is problematic. I read also an older thread about this subject. I'm not sure if it's always the case.

So wait a little bit. perhaps an update of code will fix last crashes. If no, well we will need to identify which filters crash exactly, and found something common to report to gmic team.

Best

Gilles
Comment 36 caulier.gilles 2023-03-19 07:37:12 UTC
update cimg/gmic/gmic-qt to last v3.2.2 :

https://github.com/cgilles/gmic-qt/commit/b00dccd0d003bd46c800a4141e9988495ad3fe47
Comment 37 caulier.gilles 2023-03-19 09:13:39 UTC
Hi Geoff,

Colors/Mixer LAb and Color Temperature tool from Gmic-Qt do not crash on my macbbok pro intel using Ventura. Try the last 8.0.0 pre-release bundle published today. I updated *gmic* to last 3.2.2...

Gilles
Comment 38 caulier.gilles 2023-03-19 11:21:59 UTC
Geoff,

I think it still a problem if the Gmic-qt is called more than one time: start Gmic-qt, apply a filter, close it, reopen the tool, and look if it crash...
Can you confirm ?

Else, look like the Mixer-lab work fine now :

https://i.imgur.com/NKvcEOS.png

Best

Gilles
Comment 39 Geoff King 2023-03-19 21:35:08 UTC
Hi Gilles, 
I tried with latest version today and can confirm those two filters (Colors/Mixer LAB and Color Temperature) do not crash.  I also tried opening and closing the plugin several times running different filters and had zero crashes while using it with several edits to a photo.  
However, it did crash upon closing digikam.  

Geoff
Comment 40 caulier.gilles 2023-03-20 06:08:55 UTC
Hi Geof,

The PKG 8.0.0 pre-release installer must have the last crash fixed, i think. Please try and report me...

Best

Gilles
Comment 41 caulier.gilles 2023-03-20 06:38:53 UTC
Hi Geoff

Now, as the plugin can be called more than once, i see another problem with the image data.

1/ Apply a filter from GMic
2/ Recall Gmic
3/ Look the preview is full transparent.

This happen only with certain kind of images. It's probably relevant of number of color channels. I will take a look.

Q: do you know if a host application use GmicQt in a batch processing ? Typically, the idea is to make a digiKam Batch Queue Manager plugin...

Best

Gilles
Comment 42 caulier.gilles 2023-03-21 05:11:26 UTC
Geoff,

Take a care about this bug too: #467215

In other words, do not touch the dark theme settings in gmic-qt, until i rebuild the macos PKG.

Gilles
Comment 43 Geoff King 2023-03-22 00:52:31 UTC
Hi Gilles, 
GmicQT seems to be working really good now. 
I messed with it for a good while tonight and found crash issues with g'mic in testing.  Now trying with a 2015 MacBook and MacOS 12.6.3. 

(In reply to caulier.gilles from comment #41)
> 
> Now, as the plugin can be called more than once, i see another problem with
> the image data.
> 
> 1/ Apply a filter from GMic
> 2/ Recall Gmic
> 3/ Look the preview is full transparent.
> 
> This happen only with certain kind of images. It's probably relevant of
> number of color channels. I will take a look.
> 

I do not see this issue.  But see my comment further below about transparency.  

> Q: do you know if a host application use GmicQt in a batch processing ?
> Typically, the idea is to make a digiKam Batch Queue Manager plugin...

I don't know much about batch processing with GmicQT.  Would be a nice addition I think. 

One Gmic issue I did see was that within GmicQT for some filters they have transparent areas, but the transparent parts were saved as black.  For example the polaroid filter has a transparent outline.  When I saved the image in Digikam this area turned black. I tried setting the Image Editor workspace format as PNG and exporting to PNG and TIFF and some other formats.   After exporting, I tried opening the saved files in Affinity.  Maybe I'm missing something, since I haven't really done a lot of transparency or editing in Digikam, but have done various transparency stuff in the past in other programs.  

Regards, Geoff
Comment 44 Geoff King 2023-03-22 11:52:54 UTC
Hi, To add to my note about alpha transparency.  
If I start with png that I know has alpha transparency created in Affinity, it works fine.  I can see with the transparency in digikam.  GmicQT edits and exports image back into digikam with alpha transparency as png just fine.  

Maybe original starting image needs to have alpha transparency? 

Regards, Geoff
Comment 45 caulier.gilles 2023-03-22 12:07:58 UTC
Hi Geoff,

Nope. the transparency is a property of image in digiKam which is converted to CImg container used by GMicQt. And the reverse operation is also done of course. I'm sure i write the code (:=)))...

I don't remember how i created this dysfunction. and i cannot reproduce the problem now. Perhaps i used a GMicQt filter which have a bug...

Gilles
Comment 46 caulier.gilles 2023-03-22 16:24:25 UTC
Hi Geoff,

I found a possible case where alpha channel is populated with nothing but exists in memory when converting from DK container to GMic container.

It fixed with this commit:

https://github.com/cgilles/gmic-qt/commit/777d351e422c8d268f2af96e106e7909077c556f

For the Batch process i found the code in GMicQt (headless engine). It's also used in Krita, but i don't see how krita can batch process more than one file...

Gilles

Gilles
Comment 47 caulier.gilles 2023-03-23 04:50:05 UTC
This file is now fixed with next 8.0.0 release.
Comment 48 caulier.gilles 2023-03-26 08:28:46 UTC
Hi Geoff,

I write a G'MIC-Qt chapter in the digiKam online documentation. If you can take a look and give me a feedback, it will be very appreciate:

https://docs.digikam.org/en/image_editor/enhancement_tools.html#g-mic-qt-tool

Thanks in advance

Gilles Caulier
Comment 49 Geoff King 2023-03-26 22:01:20 UTC
Created attachment 157604 [details]
attachment-1677493-0.html

Hi Gilles,
I read through the G'MIC-Qt chapter in the digiKam online documentation and
it looks good to me.   I didn’t see any obvious errors.     I could suggest
a few minor grammatical or style changes if we want to be picky, but that
may be just regional language use preference.  If you would like me to
suggest edits what is the best way to do that?

Thanks, Geoff

On Sun, Mar 26, 2023 at 4:28 AM <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=422996
>
> --- Comment #48 from caulier.gilles@gmail.com ---
> Hi Geoff,
>
> I write a G'MIC-Qt chapter in the digiKam online documentation. If you can
> take
> a look and give me a feedback, it will be very appreciate:
>
>
> https://docs.digikam.org/en/image_editor/enhancement_tools.html#g-mic-qt-tool
>
> Thanks in advance
>
> Gilles Caulier
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 50 caulier.gilles 2023-03-27 06:00:47 UTC
If you have a KDE gitlab account, just fork the documentation repository, fix text, and create a merge request.

I detailed all stages to do it in the README/Contribute Workflow section:

https://invent.kde.org/documentation/digikam-doc/-/blob/master/README.md

File to patch is this one :  digikam-doc/image_editor/enhancement_tools.rst

Look the last section at end of file.

Gilles
Comment 51 Geoff King 2023-03-29 22:53:32 UTC
Hi Gilles, 
I created an account, forked, edited the text, saved 2 patch/commit files, and made a merge request.   I got a message "Merge blocked: fast-forward merge is not possible. To merge this request, first rebase locally." Reading through the help file,  I tried /rebase in a comment, but not sure that did anything.  Any recommendations?  

Sorry to bother you with something like this, I've never used git or this system before so I'm probably missing something simple.
Comment 52 caulier.gilles 2023-03-30 03:27:29 UTC
Created attachment 157713 [details]
git rebase instruction 1

Hi Geoff,

The  rebase instruction is given in the merge request / Changes view, because there is a conflict to solve as another guy as committed a fix in the head repository (a translator who review typo).

Gilles
Comment 53 caulier.gilles 2023-03-30 03:27:58 UTC
Created attachment 157714 [details]
git rebase instruction 2
Comment 54 David Tschumperlé 2023-03-31 17:12:04 UTC
Gilles, we finally found the bug in G'MIC 3.2.2.
It should be fixed with this commit: https://github.com/GreycLab/gmic/commit/617c3ee986f42f3fce67e173b3e5f3e8f4e5fcd4

We'll try to release 3.2.3 next week, with a few improvements over the bugfix.
Comment 55 caulier.gilles 2023-03-31 17:14:57 UTC
Great. I will update the digiKam when new release will be available

Gilles