Bug 434299 - No entries in Imagemagick Loader when in Appimage
Summary: No entries in Imagemagick Loader when in Appimage
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-Magick (show other bugs)
Version: 7.2.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-11 20:27 UTC by Kaenguru
Modified: 2021-03-22 15:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.2.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaenguru 2021-03-11 20:27:46 UTC
I don#t have these entries in my Appimage installation of digikam (7.1 as well as 7.2rc)


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

digiKam Linux AppImage Bundle
digikam 7.1.0 
KDE Frameworks 5.73.0
Qt 5.14.2 (kompiliert gegen 5.14.2)
Das xcb Fenstersystem
Comment 1 caulier.gilles 2021-03-11 22:13:43 UTC
yes. From Setup/Plugins/Loader; ImageMagick has no type mime entry, even if plugin is loaded without problem at startup :

ikam/dimg/DImg_HEIF_Plugin.so"
Digikam::DPluginLoader::Private::appendPlugin: Plugin of type Digikam::DPluginDImg loaded from "/tmp/.mount_digiKaAvIs8x/usr/plugins/digikam/dimg/DImg_ImageMagick_Plugin.so"
Digikam::DPluginLoader::Private::appendPlugin: Plugin of type Digikam::DPluginDImg loaded from "/tmp/.mount_digiKaAvIs8x/usr/plugins/digikam/dimg/DImg_JPEG2000_Plugin.so"


This come from AppImage digiKam-7.2.0-20210311T180620-x86-64.appimage

Gilles Caulier
Comment 2 Kaenguru 2021-03-12 08:45:34 UTC
Anything I can do?
Or do I just ahve to accept it as is?
Comment 3 caulier.gilles 2021-03-12 12:38:49 UTC
Something is missing in ImageMagick embedding in AppUmage bundle. 

The native build work a expected. I suspect a missing configuration file somewhere.

I must check that while this week end.

Gilles Caulier
Comment 4 caulier.gilles 2021-03-13 08:28:29 UTC
Git commit 0435fe116fc0e3208e734c9a116c51b500445794 by Gilles Caulier.
Committed on 13/03/2021 at 08:28.
Pushed by cgilles into branch 'master'.

ImageMagick codec are installed with the CLI tools, not with the C API

M  +1    -0    project/bundles/appimage/01-build-host.sh

https://invent.kde.org/graphics/digikam/commit/0435fe116fc0e3208e734c9a116c51b500445794
Comment 5 caulier.gilles 2021-03-13 08:33:46 UTC
Git commit 01414ff0320e5952280390bce0f8405a122a41d5 by Gilles Caulier.
Committed on 13/03/2021 at 08:34.
Pushed by cgilles into branch 'master'.

copy ImageMagick codecs in AppImage bundle

M  +3    -0    project/bundles/appimage/04-build-appimage.sh

https://invent.kde.org/graphics/digikam/commit/01414ff0320e5952280390bce0f8405a122a41d5
Comment 6 caulier.gilles 2021-03-16 17:15:25 UTC
Maik,

I patched AppImage bundle scripts to include IM.so, and configuration files from /etc. 

It still no type mime listed in Setup/Plugins/Loaders page for IM.

The native version work as expected. With AppImage i do not see qdebug trace about IM exceptions which can be generated in image loader.

I tried to decript how IM get these values at run time... 

https://imagemagick.org/api/MagickCore/magick_8c_source.html

So it call GetMagickInfoList() ->  GetNumberOfNodesInSplayTree() -> GetNextValueInSplayTree()

... and the Q still open. Where IM will get these values. Configuration files are XML generated at compile times. But i have a doubt as this will not give any difference with or without these file included in the bundle...

Gilles
Comment 7 Maik Qualmann 2021-03-16 17:57:11 UTC
I'll take a look at it, it's not a new problem, the AppImage from digiKam-6.4.0 also has no loader module. The digiKam Windows version works. I don't see any additional ImageMagick files in Windows, except for the lib and core.

Maik
Comment 8 Maik Qualmann 2021-03-16 19:33:38 UTC
Gilles, I think the compiler options are no longer correct.

https://github.com/ImageMagick/ImageMagick/blob/main/Install-unix.txt

An example --without-x ==> --with-x=no
MXE also uses --with-x=no

Maik
Comment 9 Maik Qualmann 2021-03-16 19:36:33 UTC
The option --with-modules=no must be set, this is now "yes" by default.

Maik
Comment 10 caulier.gilles 2021-03-16 21:06:01 UTC
yes, sure, but i don't recompile IM for AppImage, i use system based rpm as well.

Gilles
Comment 11 Maik Qualmann 2021-03-16 21:12:41 UTC
The system-based imageMagick version should use modules like here with openSUSE. Then we would have to copy all of the bmp.so, jpeg.so etc. in the coders folder into the AppImage.

Maik
Comment 12 caulier.gilles 2021-03-16 21:19:06 UTC
yes i tried to copy all IM.so files in internal /lib from AppImage. It do not work.

It simple to test : run digiKam from AppImage. switch to a console and look in /tmp. there is a temporary folder created by appimage with all bundle contents.

Copy all files to a place in your home directory and re-arrange the files. to try, just restart digiKam with main script AppRun ans look the effect...

Gilles
Comment 13 Maik Qualmann 2021-03-16 22:13:22 UTC
ImageMagick also knows environment variables, but so far no success.

Maik
Comment 14 caulier.gilles 2021-03-17 04:09:34 UTC
which environment variables do you tune exactly ?

Gillrs
Comment 15 caulier.gilles 2021-03-17 04:32:49 UTC
https://imagemagick.org/script/resources.php

I think the most important is $MAGICK_CONFIGURE_PATH and coder.xml

The variable must be set in AppRun script as for gphoto2:

https://invent.kde.org/graphics/digikam/-/blob/master/project/bundles/appimage/data/AppRun#L74

Gilles
Comment 16 Maik Qualmann 2021-03-17 06:39:58 UTC
The following variables can be found in module.c:

MAGICK_CODER_MODULE_PATH
MAGICK_CODER_FILTER_PATH
MAGICK_HOME 

Maik
Comment 17 Maik Qualmann 2021-03-17 11:31:12 UTC
Gilles,

this works:

export MAGICK_CODER_MODULE_PATH=$DIR/usr/lib/ImageMagick-6.9.10/modules-Q16/coders
export MAGICK_CODER_FILTER_PATH=$DIR/usr/lib/ImageMagick-6.9.10/modules-Q16/filters

Maik
Comment 18 caulier.gilles 2021-03-17 11:58:12 UTC
perfect, i will patch the script.

Do we need the xml config files or i can drop all ?

Note : AppImage currently build under Mageia6. After 7.2.0 release i will move AppImage under Mageia7.1 which use ImageMagick 7 instead 6.

Gilles
Comment 19 caulier.gilles 2021-03-17 12:03:17 UTC
Git commit c2aae8448853d381ed511c855cdd587638946c0f by Gilles Caulier.
Committed on 17/03/2021 at 11:50.
Pushed by cgilles into branch 'master'.

add environnement variable for AppImage run-times to deal with ImageMagick shared libs

M  +6    -0    project/bundles/appimage/data/AppRun

https://invent.kde.org/graphics/digikam/commit/c2aae8448853d381ed511c855cdd587638946c0f
Comment 20 caulier.gilles 2021-03-17 14:15:18 UTC
Problem fixed with AppImage build today :

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

Gilles Caulier
Comment 21 Maik Qualmann 2021-03-17 18:13:10 UTC
The "config-Q16" folder can be removed.

Maik
Comment 22 caulier.gilles 2021-03-17 18:32:59 UTC
Done. And what's about /etc/ImageMagick ?

Gilles
Comment 23 Maik Qualmann 2021-03-17 18:39:01 UTC
Also works without /etc/ImageMagick-6

Maik
Comment 24 caulier.gilles 2021-03-17 22:04:39 UTC
Git commit 22dff9e3ac4fb3de0db545ba8e910e50648ee599 by Gilles Caulier.
Committed on 17/03/2021 at 22:03.
Pushed by cgilles into branch 'master'.

don't include /etc/ImageMagick in AppImage bundle

M  +0    -1    project/bundles/appimage/04-build-appimage.sh

https://invent.kde.org/graphics/digikam/commit/22dff9e3ac4fb3de0db545ba8e910e50648ee599
Comment 25 Kaenguru 2021-03-18 14:50:48 UTC
(In reply to caulier.gilles from comment #20)
> Problem fixed with AppImage build today :
> 
> https://i.imgur.com/ZlEur0A.png
> 
> Gilles Caulier

I tried the appimage of yesterday 
digiKam-7.2.0-20210317T181214-x86-64.appimage
and it still looks like this:
https://u.pcloud.link/publink/show?code=XZeqEBXZcv9Qv7WkVnFR53CaHEXLp7qSqHPk
Comment 26 Maik Qualmann 2021-03-18 21:12:51 UTC
Git commit d51d5527b6cba18a05244db664618ef5d60326b6 by Maik Qualmann.
Committed on 18/03/2021 at 21:11.
Pushed by mqualmann into branch 'master'.

correct the paths to the ImageMagick modules

M  +2    -2    project/bundles/appimage/data/AppRun

https://invent.kde.org/graphics/digikam/commit/d51d5527b6cba18a05244db664618ef5d60326b6
Comment 27 Kaenguru 2021-03-22 15:16:09 UTC
It finally works since the appimage from March 19.
Thank you very much.