DVswitch crashes when loading png

Thanks for responding.

Blockquote It’s worth checking whether the application is portable once compiled.

It is portable, it can be run from any folder even the snap binaries from the installed snap as long as the right libs are in place and the /usr/local/share/dvswitch/ folder contains the png’s.

Blockquote Some applications hard-code paths at compile-time, but others allow overriding locations via environment variables.

There is a partly hardcoded path $sharedir/dvswitch/pri-video-source.png" in the “src/dv_selector_widget.cpp” probably set by DSHAREDIR flag during compile some-where/how. For the fun I changed it to “/snap/dvswitch/current/usr/local/share/dvswitch/pri-video-source.png” and now running dvswitch from the snap gets a little bit further :-). But stopping on a real hard to fix snap issue since “gdk-pixbuf-query-loaders” is not run to create a cache inside the snap?

dvswitch -p 1234 -h 127.0.0.1

(process:2295): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Gtk-Message: Failed to load module "unity-gtk-module"
Gtk-Message: Failed to load module "gail"
Gtk-Message: Failed to load module "atk-bridge"
Gtk-Message: Failed to load module "canberra-gtk-module"

(dvswitch:2295): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
ERROR: Couldn't recognize the image file format for file '/snap/dvswitch/current/usr/local/share/dvswitch/pri-video-source.png'

According to the info from the following pixbuf related links: https://bugs.launchpad.net/snapcraft/+bug/1576289 https://github.com/ubuntu/snapcraft-desktop-helpers/issues/42

It seems that when adding a desktop icon launcher to snap, which is possible for dvswitch since it is the GUI part of the app that might/will trigger the pixbuf cache generating for *.png formats in the snap. Well I hope so.

Do you happen to know more about this pixbuf cache generating or will be using a new snapcraft version wil fix this, since that is also somehow asserted in one of the threads?

Blockquote The longer term solution is to work with the project maintainers to add support into the project to provide overriding support to the currently-hard-coded paths.

The dvswitch project is sadly denounced dead a couple of years ago, so setting new snap focused hard coded paths is possible, but maybe not needed.