[Linux] Check for libraries under /usr/lib/x86_64-linux-gnu/

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

[Linux] Check for libraries under /usr/lib/x86_64-linux-gnu/

Post by winnylinny »

There is a common issue with XnViewMP on Linux in which it does not correctly detect HEIF / HEIC support.

See this forum thread for reference (and a temporary solution that users can use in the meantime):
viewtopic.php?p=184814#p184814


This problem can be alleviated if XnViewMP also checks under /usr/lib/x86_64-linux-gnu/

Distros that assume pure 64-bit ecosystems will save their libraries directly under /usr/lib/, which is expected from installed software.

However, other distros (such as Ubuntu) will split certain library files into 32-bit and 64-bit specific directories.

If XnViewMP also checks under /usr/lib/x86_64-linux-gnu/, then it will correctly find and load the HEIF library for users of Ubuntu and Ubuntu-based related distros. :)
Last edited by winnylinny on Sun Feb 12, 2023 5:38 pm, edited 1 time in total.
User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

Re: [Linux] Check for libraries under /usr/lib/x86_64-linux-gnu/

Post by winnylinny »

I just realized this might introduce a new problem, for example if it finds the same library file in two different locations.

Perhaps XnViewMP can "prioritize" where it finds library files? (Maybe it already does this?)

For example:
  1. First check under XnViewMP's own folders
  2. Then check under /usr/lib/
  3. Then check under /usr/lib/x86_64-linux-gnu/
I believe XnViewMP already does this. So all you will need to do is add another path: /usr/lib/x86_64-linux-gnu/
User avatar
xnview
Author of XnView
Posts: 43132
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: [Linux] Check for libraries under /usr/lib/x86_64-linux-gnu/

Post by xnview »

perhaps by changing LD_LIBRARY_PATH
Pierre.
ani-avif
Posts: 2
Joined: Sun Jul 30, 2023 4:29 pm

Re: [Linux] Check for libraries under /usr/lib/x86_64-linux-gnu/

Post by ani-avif »

.so loading is controlled by /etc/ld.so.conf.d/, which already has x86_64-linux-gnu.conf with the following content:

Code: Select all

# Multiarch support
/usr/local/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu
HEIF fails because x86_64-linux-gnu has no libheif.so in it. The following fixed the problem on machine; no symlinks in /usr/lib were necessary:

Code: Select all

sudo ln -s /usr/lib/x86_64-linux-gnu/libheif.so.1 /usr/lib/x86_64-linux-gnu/libheif.so
Maybe XnView should link to libheif.so.1, not libheif.so?