G'MIC Makefile changes possible?

Hi @David_Tschumperle

Just a question related to some details of the G’MIC Makefile, in install phase few things are happening:

Install / uninstall / clean

#-----------------------------
install:
mkdir -p (DESTDIR)(PREFIX)/(INCLUDE) mkdir -p (DESTDIR)(PREFIX)/(BIN)
mkdir -p (DESTDIR)(PLUGIN)/gmic_gimp_qt

The last line is a bit problematic… When I try to build g’mic as Gimp flatpak extension it causes an error when trying to write to non-writable path:

mkdir -p /app/lib/gimp/3.0/plug-ins/gmic_gimp_qt
mkdir: cannot create directory ‘/app/lib/gimp/3.0/plug-ins/gmic_gimp_qt’: Read-only file system

The reason is that because the gimptool returns this path and its used just like that.

Do you know if it would be possible to make this (DESTDIR)(PLUGIN)/gmic_gimp_qt directory creation as optional? Or steered by some variable?

Thanks!

Uh formatting got a bit screwed,

mkdir -p $(DESTDIR)$(PREFIX)/$(INCLUDE)
mkdir -p $(DESTDIR)$(PREFIX)/$(BIN)
mkdir -p $(DESTDIR)$(PLUGIN)/gmic_gimp_qt
mkdir -p $(DESTDIR)$(SHARE)/gmic
mkdir -p $(DESTDIR)$(PREFIX)/$(LIB)

Ok so its all about this third line…

Hello @activey ,
I’m open to any kind of changes in the Makefile, assuming it won’t break what is already working :wink:

For instance, make install is used (automatically) when creating the .deb package, to tell which files have to be copied, and where.

Wouldn’t it be possible to add a new entry like user_install or something similar in your case ? Is the install target name mandatory ?

I will fork g’mic and play a bit with it, will get back to you :slight_smile:

1 Like

Aaaallright, here is one of the generated plugins working in GIMP 3.0.6 inside flatpak :slight_smile:

After loooong investigation and dozen of iterations I was able to prepare a .flatpak setup that does it automatically ;>

Phew, enough for today, more will come…

1 Like

And btw, I decided to not do any changes in G’MIC codebase itself and I will just use a small .patch file instead in my custom build that will just won’t even try to create mentioned directory :blush:

I’m not entirely sure why is it so… fast tho.

3 Likes

Feel free to provide your changes to see if G’MIC can be made faster. Not to modify G’MIC itself, but to see if we can replicate.

Something I’ve noticed with the plug-in for GIMP is that the pixel buffer transfer from/to GIMP using the plug-in API takes quite a lot of time.
If in your implementation, this buffer transfer is significantly faster, that may explain the difference. Perhaps there is a way to speed up this step inside the plug-in code ?

EDIT: Looks like G’MIC-Qt uses function
gimp_pixel_rgn_set_rect(&region, (guchar *)img.data(), rgn_x, rgn_y, rgn_width, rgn_height);

to transfer the image to GIMP. Not sure if this is the best way to do that.

Hm, might be.

To be honest I’m not really planning to do any changes in GMIC-qt as I need to focus on RasterFlow instead :}

btw, I had to report this strange Gimp bug Non editable GEGL when aux pad is present (#15528) · Issues · GNOME / GIMP · GitLab

so as it comes to Gimp3 I need to disable aux input for now…

It seems its not only Gimp3 but also 2 :wink:

Is it possible to replace the AUX input with image loading like in the GEGL Styles filter? This preserves the fx.

Hm, will have a look, thanks!