Issue compiling GDK-Pixbuf

Hi I am trying to package GDK-Pixbuf on our distro.

However the build fails with:

Found ninja-1.9.0.git.kitware.dyndep-1.jobserver-1 at /System/Index/bin/ninja
[42/277] Generating gdk-pixbuf/gdk-pixbuf-marshal_c with a custom command
INFO: Reading ../gdk-pixbuf/gdk-pixbuf-marshal.list...
[64/277] Generating gdk-pixbuf/gdk-pixbuf-marshal_h with a custom command
INFO: Reading ../gdk-pixbuf/gdk-pixbuf-marshal.list...
[257/277] Generating tests/resources.c with a custom command
FAILED: tests/resources.c 
/usr/bin/python3.8 /Data/Compile/Sources/gdk-pixbuf-2.42.6/build-aux/gen-resources.py --glib-compile-resources=/System/Index/bin/glib-compile-resources --pixdata=/Data/Compile/Sources/gdk-pixbuf-2.42.6/_build/gdk-pixbuf/gdk-pixbuf-pixdata --loaders=/Data/Compile/Sources/gdk-pixbuf-2.42.6/_build/gdk-pixbuf/loaders.cache --sourcedir=/Data/Compile/Sources/gdk-pixbuf-2.42.6/tests --source ../tests/resources.gresource.xml tests/resources.c
failed to load "/Data/Compile/Sources/gdk-pixbuf-2.42.6/tests/icc-profile.png": Couldn?t recognize the image file format for file ?/Data/Compile/Sources/gdk-pixbuf-2.42.6/tests/icc-profile.png?
../tests/resources.gresource.xml: Child process exited with code 1.
[258/277] Generating tests/resources.h with a custom command
FAILED: tests/resources.h 
/usr/bin/python3.8 /Data/Compile/Sources/gdk-pixbuf-2.42.6/build-aux/gen-resources.py --glib-compile-resources=/System/Index/bin/glib-compile-resources --pixdata=/Data/Compile/Sources/gdk-pixbuf-2.42.6/_build/gdk-pixbuf/gdk-pixbuf-pixdata --loaders=/Data/Compile/Sources/gdk-pixbuf-2.42.6/_build/gdk-pixbuf/loaders.cache --sourcedir=/Data/Compile/Sources/gdk-pixbuf-2.42.6/tests --header ../tests/resources.gresource.xml tests/resources.h
failed to load "/Data/Compile/Sources/gdk-pixbuf-2.42.6/tests/icc-profile.png": Couldn?t recognize the image file format for file ?/Data/Compile/Sources/gdk-pixbuf-2.42.6/tests/icc-profile.png?
../tests/resources.gresource.xml: Child process exited with code 1.
[261/277] Generating gdk-pixbuf/GdkPixbuf-2.0.gir with a custom command
ninja: build stopped: subcommand failed.

I have reported it as an issue here: https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/206

But sadly the Gdk-Pixbuf bug tracker seems dormant.
There is a similar issue here https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/175 which is exactly a year old, and has not received a single answer.

I hope I can be pointed into the right direction :slight_smile:

Thanks in advance,
nuc

The issue tracker is not dormant: it’s just that 99% of build issues are typically an issue of a broken build environment.

It seems you’re building gdk-pixbuf in a separate prefix. Are you also setting up all the environment variables to let gdk-pixbuf and glib-compile-resources load the correct pixbuf loaders?

Additionally, the PNG image loader should be built into the shared library, which means you should not trying to load it separately. The error you’re seeing could be caused by an environment that is picking up the wrong gdk-pixbuf, or the wrong loaders directory, or the wrong loaders.cache file.

Hi, thanks for looking into it.

My meson options are as follows:

gdk-pixbuf 2.42.8

  Loaders
    Shared modules   : True
    Enabled loaders  : png
                       jpeg
                       tiff
    Builtin loaders  : all

  Build
    Debugging        : False
    Optimization     : 3
    GIO MIME sniffing: True
    MediaLib         : False
    Introspection    : True
    Documentation    : False
    Manual pages     : True
    Relocatable      : False
    Installed tests  : False

  Directories
    prefix           : /usr
    libdir           : /usr/lib
    datadir          : /usr/share
    libexecdir       : /usr/lib

  Subprojects
    gi-docgen        : NO python3 is missing modules: jinja2, markdown, pygments, toml, typogrify

  User defined options
    buildtype        : release
    prefix           : /usr
    builtin_loaders  : all
    installed_tests  : false

The build directory is /Data/Compile/Sources/gdk-pixbuf-2.42.8/

It seems you’re building gdk-pixbuf in a separate prefix. Are you also setting up all the environment variables to let gdk-pixbuf and glib-compile-resources load the correct pixbuf loaders?

No I do not think so. Where are the correct pixbuf loaders? In the build dir? What are the environment variables I need to set?

The error you’re seeing could be caused by an environment that is picking up the wrong gdk-pixbuf, or the wrong loaders directory, or the wrong loaders.cache file.

According to the output from my initial post, it seems that it picks the gdk-pixbuf from my build dir, the loaders.cache file from my build dir, and the glib-compile-resources binary from my system.

Hi, @ebassi or any others, - do you have any more pointers to look into?

I am stuck on compiling GDK-Pixbuf for weeks now, and I would really like to resolve it :slight_smile:

Hi, the solution was to unset the following env variable like so → GDK_PIXBUF_MODULEDIR=.

Probably it used the current installation instead of the build folder :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.