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

--- Comment #7 from Nicholas LaPointe <nicholaslapoin...@gmail.com> ---
(In reply to Alvin Wong from comment #6)
> Hi Nicholas, since I saw that you've fixed a few things regarding gmic-qt in
> the past, perhaps you will know better than me?

I looked at this a bit and am not sure how to fix it myself, but I'll tell you
what I found.

There are separate enumerations for InputLayerMode and OutputMode inside of
gmic.h that respectively match the "Input layers..." and "Output mode..."
controls inside of G'MIC-Qt.
Krita receives the correct OutputMode value when getting a
"gmic_qt_output_images" message. It stores the value to m_outputMode (QMic.cpp
line 245).
(m_outputMode is never used for anything (it's only set, then set again if its
value wasn't IN_PLACE), since Krita only supports IN_PLACE (I believe it was
that way before G'MIC-Qt, as well.))

Similarly, the "gmic_qt_get_cropped_images" message leads to properly setting
m_inputMode with an InputLayerMode.
This value is used to generate a QList of the nodes which will be sent to G'MIC
for processing (QMic.cpp line 398), and also for knowing what nodes will
receive an image from G'MIC (QMic.cpp line 382).


When running the "Blend [standard]" filter with two layers in the document and
the ALL_LAYERS input mode, G'MIC gets two images and produces one.
When we get the image back from G'MIC, we'll get to the above-mentioned line
382, which will end up causing Krita to try to apply images to two layers.
Since there was only one image from G'MIC, Krita crashes.

The same filter can also return, for example, two images given four input
images, so placing the results into the correct layers may have to be taken
into account when coming up with a fix.

(Krita (1fbbed33e6cbc22debfca29fe995772977d4fefe, before G'MIC-Qt) had
different behavior when compared to GIMP with G'MIC-Qt in regards to the
deletion of layers after running the filter, so I suspect that it may have put
the results into the wrong layers. I haven't done much to check this in any
way, however.)


Let me know if there is anything that needs more explanation or testing.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to