I am trying to use GdkPixbuf as follows in my Python application:
file = Gio.File("/path/to/img.jpg")
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(file.get_path(), 200, 200, preserve_aspect_ratio=True)
However, when I run this with Flatpak from Gnome Builder, I get the following error:
future: <GLibTask finished name='None' coro=<myfunc() done, defined at /app/share/myapp/myapp/myfile.py:123> exception=GLib.Error('Loader process exited early with status '1'Command:
env -i XDG_RUNTIME_DIR="/run/user/1000" "flatpak-spawn" "--sandbox" "--watch-bus" "--directory=/" "--forward-fd=47" "prlimit" "--as=16464950067" "/usr/libexec/glycin-loaders/2+/glycin-image-rs" "--dbus-fd" "47"', 'gdk-pixbuf-error-quark', 0)>
Traceback (most recent call last):
File "/app/share/myapp/myapp/myfile.py", line 132, in _set_image_file
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(file.get_path(), 200, 200, preserve_aspect_ratio=True)
gi.repository.GLib.GError: gdk-pixbuf-error-quark: Loader process exited early with status '1'Command:
env -i XDG_RUNTIME_DIR="/run/user/1000" "flatpak-spawn" "--sandbox" "--watch-bus" "--directory=/" "--forward-fd=47" "prlimit" "--as=16464950067" "/usr/libexec/glycin-loaders/2+/glycin-image-rs" "--dbus-fd" "47" (0)
When I set a breakpoint with pdb and run above command, I get:
(Pdb) os.system("/usr/libexec/glycin-loaders/2+/glycin-image-rs --dbus-fd 47 gdk-pixbuf-error-quark 0")
thread 'main' (15) panicked at /buildstream/gnome/sdk/glycin.bst/.vendored-crates/glycin-utils-4.0.4/src/instruction_handler.rs:100:14:
Failed to create private DBus connection: InputOutput(Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
25856
Does anyone has succeeded in making this run?