gdk-pixbuf unable to recognize image formats (JPG, PNG, etc.)

  • Open
  • quality assurance status badge
Details
5 participants
  • Josselin Poiret
  • Liliana Marie Prikler
  • Nathan Dehnel
  • pelzflorian (Florian Pelz)
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Nathan Dehnel
Severity
normal
N
N
Nathan Dehnel wrote on 10 May 2023 20:50
(name . bug-guix)(address . bug-guix@gnu.org)
CAEEhgEtWyKdC-d-SYHMp5fDTx0CBw7pCcsJxFv-ZDCuPX909Cg@mail.gmail.com
Gtk:ERROR:gtkiconhelper.c:494:
ensure_surface_for_gicon: assertion
failed (error == NULL): Failed to load
/run/current-system/profile/share/icons/Adwaita/16x16/status/image-missing.png:
Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:gtkiconhelper.c:494:ensure_surface_for_gicon:
assertion failed (error == NULL): Failed to load
/run/current-system/profile/share/icons/Adwaita/16x16/status/image-missing.png:
Unrecognized image file format (gdk-pixbuf-error-quark, 3)

This is breaking various apps like viewnior, xfce4-power-manager,
causing firefox to crash when opening the file picker, making app
icons not appear, etc.

guix version b7e7744
S
S
Sharlatan Hellseher wrote on 11 May 2023 00:24
(address . 63427@debbugs.gnu.org)
CAO+9K5o_1CboVa52PNODyUQevw_JVWG=OJUvQm=RhEnp1hEPQg@mail.gmail.com
Hi,
How to reproduce the issue? May you, please provide some steps please.
--
… ??? ????? - ???????????? ?????????????? ?????? ??????? ????????
????? ????? ????? ? ??? ??????, ??????????? ????? ???????, ??
?????????? ?? ? ????????? ??????? ????? ? ?????????????????.
J
J
Josselin Poiret wrote on 11 May 2023 10:05
874joje1ii.fsf@jpoiret.xyz
Hi Nathan,

Nathan Dehnel <ncdehnel@gmail.com> writes:

Toggle quote (14 lines)
> Gtk:ERROR:gtkiconhelper.c:494:
> ensure_surface_for_gicon: assertion
> failed (error == NULL): Failed to load
> /run/current-system/profile/share/icons/Adwaita/16x16/status/image-missing.png:
> Unrecognized image file format (gdk-pixbuf-error-quark, 3)
> Bail out! Gtk:ERROR:gtkiconhelper.c:494:ensure_surface_for_gicon:
> assertion failed (error == NULL): Failed to load
> /run/current-system/profile/share/icons/Adwaita/16x16/status/image-missing.png:
> Unrecognized image file format (gdk-pixbuf-error-quark, 3)
>
> This is breaking various apps like viewnior, xfce4-power-manager,
> causing firefox to crash when opening the file picker, making app
> icons not appear, etc.

So, GDK Pixbuf has a dynamic loader mechanism, where additional formats
can be added via additional loaders, which are usually all installed in
the same directory. In Guix, this means that we need to point GDK
Pixbuf to a list of loaders to use that is dependent on what is
installed (there's no easy way to record this per-package, embed it
inside of it and then use that only there like with the ld cache). For
that, we use the environment variable GDK_PIXBUF_MODULE_FILE, which is a
search-path for the package gdk-pixbuf, meaning that it is set only if
gdk-pixbuf is installed in your profile.

Now, if we had packaged everything properly, all the applications you
mention should *propagate* gdk-pixbuf and not just list it as an input,
so that it always gets installed to the profile as well, but that's not
the case! The reason it doesn't happen for other users is because they
have some applications which pull in gdk-pixbuf inside the profile! So
we should fix this and propagate gdk-pixbuf everywhere (something which
I'm not too much a fan of, but alas).

In the meantime, you can manually install gdk-pixbuf to your profile,
log-out and log-in and it should hopefully work.

Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmRcodUQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5Fhcait3iDACIZ5wNEXGbybkKOZBMyYvcihAFJMxNqiMN
MypVqy0+rpv1E2W88Q8ezoFz7YEBPvHs527Nn0hQvwhM9MU4Y6ETJvAW7V8VKpD6
cS0ZtU9WeOPw8IC4mStQqKmd+ZHoRER3i7WXY2D3sWHbMV/tExO2nEV6sktrn+kb
SrP8jWi4mjJ+G0rijn8te35MqEx8BQrUsVxJeVxG8UECxPqr/Ii7J2K6IqqisZNM
D7FVVxz/78qoK6MZzLWz7m5Vy8dJS8Pyp4ORl1AaCChEva5JnwEwkdXl4rBoorIk
z8VhU5nP4USQTK93g2kETCk2PKPJN3QPQ2V/NW66lGJlRtbt52ZlwDu6P4Xopicb
zRTQDgRsofj9ewD6Xrh38+mGcphC7osyXPgnJkeSDbB0nZ3PRypsQxzm3OwCve6Q
1VTpZfF07QU1Zvi+LJme0bTDqVMRWKg9lwfGngvAdV4UCUo8A/CB9C4Ku5h0EkDY
IS7enJIdBEUQ7SSft8xRvjmvUeCEvBA=
=4vnz
-----END PGP SIGNATURE-----

P
P
pelzflorian (Florian Pelz) wrote on 11 May 2023 13:04
(name . Josselin Poiret via Bug reports for GNU Guix)(address . bug-guix@gnu.org)
87pm77uo1s.fsf@pelzflorian.de
Hi all.

Josselin Poiret via Bug reports for GNU Guix <bug-guix@gnu.org> writes:
Toggle quote (7 lines)
> For
> that, we use the environment variable GDK_PIXBUF_MODULE_FILE, which is a
> search-path for the package gdk-pixbuf, meaning that it is set only if
> gdk-pixbuf is installed in your profile. […] So
> we should fix this and propagate gdk-pixbuf everywhere (something which
> I'm not too much a fan of, but alas).

The cambalache package does the right thing by wrapping the program to
setenv GDK_PIXBUF_MODULE_FILE to the value it has while building the
package. glib-or-gtk build system sets GDK_PIXBUF_MODULE_FILE while
building the package. Note that gdkpixbuf and perhaps
librsvg-for-system must be in inputs.

Regards,
Florian
L
L
Liliana Marie Prikler wrote on 11 May 2023 21:11
5d2305c2acf0784713b7d32e6485a80e35171269.camel@gmail.com
Am Donnerstag, dem 11.05.2023 um 10:05 +0200 schrieb Josselin Poiret:
Toggle quote (3 lines)
> Now, if we had packaged everything properly, all the applications you
> mention should *propagate* gdk-pixbuf and not just list it as an
> input
No. Propagated inputs are *never* the result of proper packaging.
More often than not, they create more issues than they solve by
reducing Guix to the capabilities of a dumb package manager. While
yes, they have been accepted as a solution to some issues (e.g. pkg-
config not finding inputs), this by no means translates to "oh,
something's not found, let's propagate an input". However, even for
those cases where they have become accepted practice, we ought to look
for better solutions, as proliferating propagations do end up biting us
in the form of conflicts.

The only instance in which propagated inputs behave as intended is with
meta packages; there they are even slightly less clunky than their
alternative (union builds).

As for the actual problem at hand, the solution has already been
pointed out by Florian: wrapping commands to bind
GDK_PIXBUF_MODULE_FILE. Sadly, Florian didn't point these unwanted
side effects of propagation, as contributors are often unaware of them.

Cheers
N
N
Nathan Dehnel wrote on 11 May 2023 23:22
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
CAEEhgEsVG-i+wP4ZmAh5oE_AeSGAquk5DPBbenx+bUDTrqNOYw@mail.gmail.com
Installing gdk-pixbuf and rebooting didn't fix the issue:

viewnior '/home/nathan/Downloads/from-phone/Pictures/Screenshots/Screenshot_20230509-183317_F-Droid.png'

(viewnior:2482): Gtk-WARNING **: 16:14:57.820: Unable to locate theme
engine in module_path: "adwaita",

(viewnior:2482): Gtk-WARNING **: 16:14:57.822: Unable to locate theme
engine in module_path: "adwaita",
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6:
version `GLIBC_2.34' not found (required by
/gnu/store/yr4lbvdyc4dgs76yij1dw2w2z8s84af8-gnutls-3.7.7/lib/libgnutls.so.30)
Failed to load module:
/home/nathan/.guix-profile/lib/gio/modules/libgiognutls.so
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6:
version `GLIBC_2.34' not found (required by
/gnu/store/8sfnwc672lswqgkf9g5qv7r5247jyipp-libproxy-0.4.17/lib/libproxy.so.1)
Failed to load module:
/home/nathan/.guix-profile/lib/gio/modules/libgiolibproxy.so

** (viewnior:2482): WARNING **: 16:14:57.853: Pixbuf theme: Cannot
load pixmap file
/run/current-system/profile/share/themes/Adwaita-dark/gtk-2.0/assets/line.png:
Couldn’t recognize the image file format for file
“/run/current-system/profile/share/themes/Adwaita-dark/gtk-2.0/assets/line.png”


(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

** (viewnior:2482): WARNING **: 16:14:57.853: Invalid borders
specified for theme pixmap:
/run/current-system/profile/share/themes/Adwaita-dark/gtk-2.0/assets/line.png,
borders don't fit within the image

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

** (viewnior:2482): WARNING **: 16:14:57.853: Invalid borders
specified for theme pixmap:
/run/current-system/profile/share/themes/Adwaita-dark/gtk-2.0/assets/line.png,
borders don't fit within the image

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)'
failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(viewnior:2482): GdkPixbuf-CRITICAL **: 16:14:57.853:
gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

On Thu, May 11, 2023 at 2:11?PM Liliana Marie Prikler
<liliana.prikler@gmail.com> wrote:
Toggle quote (25 lines)
>
> Am Donnerstag, dem 11.05.2023 um 10:05 +0200 schrieb Josselin Poiret:
> > Now, if we had packaged everything properly, all the applications you
> > mention should *propagate* gdk-pixbuf and not just list it as an
> > input
> No. Propagated inputs are *never* the result of proper packaging.
> More often than not, they create more issues than they solve by
> reducing Guix to the capabilities of a dumb package manager. While
> yes, they have been accepted as a solution to some issues (e.g. pkg-
> config not finding inputs), this by no means translates to "oh,
> something's not found, let's propagate an input". However, even for
> those cases where they have become accepted practice, we ought to look
> for better solutions, as proliferating propagations do end up biting us
> in the form of conflicts.
>
> The only instance in which propagated inputs behave as intended is with
> meta packages; there they are even slightly less clunky than their
> alternative (union builds).
>
> As for the actual problem at hand, the solution has already been
> pointed out by Florian: wrapping commands to bind
> GDK_PIXBUF_MODULE_FILE. Sadly, Florian didn't point these unwanted
> side effects of propagation, as contributors are often unaware of them.
>
> Cheers
P
P
pelzflorian (Florian Pelz) wrote on 12 May 2023 11:19
(name . Nathan Dehnel)(address . ncdehnel@gmail.com)
87bkipaovk.fsf@pelzflorian.de
Nathan, could you try running this command:

guix shell --pure viewnior gdk-pixbuf -- viewnior

For me this works now. My guess is that for you, something else breaks
viewnior and --pure can help.

Regards,
Florian
N
N
Nathan Dehnel wrote on 12 May 2023 23:21
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
CAEEhgEtnijO1FF7YDV13whc3hMrbq47ShHiGJ0-vkB0iy8W8WQ@mail.gmail.com
Yes, that one works

On Fri, May 12, 2023 at 4:27?AM pelzflorian (Florian Pelz)
<pelzflorian@pelzflorian.de> wrote:
Toggle quote (10 lines)
>
> Nathan, could you try running this command:
>
> guix shell --pure viewnior gdk-pixbuf -- viewnior
>
> For me this works now. My guess is that for you, something else breaks
> viewnior and --pure can help.
>
> Regards,
> Florian
P
P
pelzflorian (Florian Pelz) wrote on 13 May 2023 12:49
(name . Nathan Dehnel)(address . ncdehnel@gmail.com)
87cz34ecb7.fsf@pelzflorian.de
Nathan Dehnel <ncdehnel@gmail.com> writes:
Toggle quote (2 lines)
> Yes, that one works

That’s good. This means maybe either

- if guix shell without --pure works too, you just have not run “guix
upgrade” recently, or

- --pure helped and viewnior is not compatible with the Adwaita dark
theme, or

- --pure helped because you have misconfigured something that breaks the
installed viewnior, but leaves the pure one intact.

What remains as a bug is wrapping the viewnior program inside
gdk-pixbuf, so installing gdk-pixbuf is not needed anymore. Untested
patch is attached.

But then other image loaders installed by the user to support
e.g. libexif would not be usable anymore. We could also add libexif,
but do we even want the attached patch? Or should it be up to the user
to install image loaders?

Regards,
Florian
From 29c76710eea6720aa4b5e774a83ce19e577937ac Mon Sep 17 00:00:00 2001
Message-Id: <29c76710eea6720aa4b5e774a83ce19e577937ac.1683974741.git.pelzflorian@pelzflorian.de>
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 13 May 2023 12:33:26 +0200
Subject: [PATCH] gnu: viewnior: Support image formats out of the box.

* gnu/packages/image-viewers.scm (viewnior)
[inputs]: Add 'librsvg-for-system'.
[arguments]: Enable 'glib-or-gtk?' to make available
GDK_PIXBUF_MODULE_FILE. Wrap viewnior to use it instead
of the image loaders installed by the user.
---
gnu/packages/image-viewers.scm | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)

Toggle diff (51 lines)
diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm
index db7a44d4ff..bbe26aadbe 100644
--- a/gnu/packages/image-viewers.scm
+++ b/gnu/packages/image-viewers.scm
@@ -27,6 +27,7 @@
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
;;; Copyright © 2022 Cairn <cairn@pm.me>
+;;; Copyright © 2023 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -425,12 +426,22 @@ (define-public viewnior
(base32 "14qvx1wajncd5ab0207274cwk32f4ipfnlaci6phmah0cwra2did"))))
(build-system meson-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
+ '(#:glib-or-gtk? #t
+ #:phases (modify-phases %standard-phases
(add-after 'unpack 'patch-source
(lambda _
;; Don't create 'icon-theme.cache'
(substitute* "meson.build"
- (("meson.add_install_script*") "")))))
+ (("meson.add_install_script*") ""))))
+ (add-after 'glib-or-gtk-wrap 'wrap-pixbuf
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((viewnior (string-append #$output "/bin/viewnior")))
+ (wrap-program viewnior
+ ;; Wrap GDK_PIXBUF_MODULE_FILE so viewnior can be used
+ ;; to view JPG, PNG and SVG, without the user needing
+ ;; to install gdk-pixbuf or librsvg.
+ `("GDK_PIXBUF_MODULE_FILE" =
+ (,(getenv "GDK_PIXBUF_MODULE_FILE"))))))))
#:tests? #f)) ;no tests
(native-inputs
(list gettext-minimal
@@ -440,7 +451,8 @@ (define-public viewnior
(inputs
(list exiv2
gdk-pixbuf
- gtk+-2))
+ gtk+-2
+ (librsvg-for-system)))
(home-page "https://siyanpanayotov.com/project/viewnior")
(synopsis "Simple, fast and elegant image viewer")
(description "Viewnior is an image viewer program. Created to be simple,

base-commit: e3e011a08141058598cc7631aeb52d620a3ccb8c
--
2.39.2
L
L
Liliana Marie Prikler wrote on 13 May 2023 15:50
ea87dba653d5999e8fd0da171f7875561d0c7fdd.camel@gmail.com
Am Samstag, dem 13.05.2023 um 12:49 +0200 schrieb pelzflorian (Florian
Pelz):
Toggle quote (4 lines)
> But then other image loaders installed by the user to support
> e.g. libexif would not be usable anymore.  We could also add libexif,
> but do we even want the attached patch?  Or should it be up to the
> user to install image loaders?
Given that $GDK_PIXBUF_MODULE_FILE is bound and not PATH-like, it would
be up to the package to declare those dependencies. Perhaps we ought
to have a meta-package for gdk-pixbuf with all available loaders.
Lacking that it's up to the packager to decide which formats are
important and add each one manually; though note that this practice
also allows users to override said defaults with proper modify-inputs.

Cheers
P
P
pelzflorian (Florian Pelz) wrote on 13 May 2023 20:38
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
87jzxccc17.fsf@pelzflorian.de
Hi Liliana and all. Until now the user could decide what image loaders
to install alongside. Or so I thought. However, surprisingly I cannot
get any other loader except gdk-pixbuf and librsvg to work anyway.

That is,

guix shell viewnior webp-pixbuf-loader

surprisingly does not see webp files. I do not understand.

If this changed patch looks fine, now with proper gexp use, I will push
it. The patch continues to include gdk-pixbuf among the inputs even
though gtk+@2 propagates gdk-pixbuf anyway, but better be explicit.

Regards,
Florian
From 6acc7322695a13c326918c4b83a999e324406b21 Mon Sep 17 00:00:00 2001
Message-Id: <6acc7322695a13c326918c4b83a999e324406b21.1684001649.git.pelzflorian@pelzflorian.de>
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 13 May 2023 12:33:26 +0200
Subject: [PATCH] gnu: viewnior: Support image formats out of the box.

* gnu/packages/image-viewers.scm (viewnior)
[inputs]: Add 'librsvg-for-system'.
[arguments]: Enable 'glib-or-gtk?' to make available
GDK_PIXBUF_MODULE_FILE. Wrap viewnior to use it instead
of the image loaders installed by the user.
---
gnu/packages/image-viewers.scm | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)

Toggle diff (58 lines)
diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm
index db7a44d4ff..798a8e50e8 100644
--- a/gnu/packages/image-viewers.scm
+++ b/gnu/packages/image-viewers.scm
@@ -27,6 +27,7 @@
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
;;; Copyright © 2022 Cairn <cairn@pm.me>
+;;; Copyright © 2023 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -425,13 +426,24 @@ (define-public viewnior
(base32 "14qvx1wajncd5ab0207274cwk32f4ipfnlaci6phmah0cwra2did"))))
(build-system meson-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
- (add-after 'unpack 'patch-source
- (lambda _
- ;; Don't create 'icon-theme.cache'
- (substitute* "meson.build"
- (("meson.add_install_script*") "")))))
- #:tests? #f)) ;no tests
+ (list #:glib-or-gtk? #t
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-source
+ (lambda _
+ ;; Don't create 'icon-theme.cache'
+ (substitute* "meson.build"
+ (("meson.add_install_script*") ""))))
+ (add-after 'glib-or-gtk-wrap 'wrap-pixbuf
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((viewnior (string-append #$output "/bin/viewnior")))
+ (wrap-program viewnior
+ ;; Wrap GDK_PIXBUF_MODULE_FILE so viewnior can be used
+ ;; to view JPG, PNG and SVG, without the user needing
+ ;; to install gdk-pixbuf or librsvg.
+ `("GDK_PIXBUF_MODULE_FILE" =
+ (,(getenv "GDK_PIXBUF_MODULE_FILE"))))))))
+ #:tests? #f)) ;no tests
(native-inputs
(list gettext-minimal
`(,glib "bin") ;glib-genmarshal
@@ -440,7 +452,8 @@ (define-public viewnior
(inputs
(list exiv2
gdk-pixbuf
- gtk+-2))
+ gtk+-2
+ (librsvg-for-system)))
(home-page "https://siyanpanayotov.com/project/viewnior")
(synopsis "Simple, fast and elegant image viewer")
(description "Viewnior is an image viewer program. Created to be simple,

base-commit: e3e011a08141058598cc7631aeb52d620a3ccb8c
--
2.39.2
N
N
Nathan Dehnel wrote on 15 May 2023 07:18
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
CAEEhgEvvw48U0x3qzznG+DFiHb495QkP__g7=9BoABPmwkdBrQ@mail.gmail.com
With another update, the errors went away. Thanks

On Sat, May 13, 2023, 13:38 pelzflorian (Florian Pelz) <
pelzflorian@pelzflorian.de> wrote:

Toggle quote (17 lines)
> Hi Liliana and all. Until now the user could decide what image loaders
> to install alongside. Or so I thought. However, surprisingly I cannot
> get any other loader except gdk-pixbuf and librsvg to work anyway.
>
> That is,
>
> guix shell viewnior webp-pixbuf-loader
>
> surprisingly does not see webp files. I do not understand.
>
> If this changed patch looks fine, now with proper gexp use, I will push
> it. The patch continues to include gdk-pixbuf among the inputs even
> though gtk+@2 propagates gdk-pixbuf anyway, but better be explicit.
>
> Regards,
> Florian
>
Attachment: file
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 63427@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 63427
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch