HEIF library not found for reading HEIC files (ubuntu) - (solved, but have follow up ques)

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

Posts: 1
Joined: Wed Mar 15, 2023 3:02 pm

HEIF library not found for reading HEIC files (ubuntu) - (solved, but have follow up ques)

Post by tsreyb »

I was unable to convert HEIC files on my linux machine (Linux Mint 21 Vanessa). xnconvert was reporting that the files were not image files.

I composed my question here and was ready to send it, but then I thought I'd dig around a bit more. Fortunately I solved the situation via some reverse-engineering investigation. I used strace to see what files xnconvert was *trying* to open. I noticed it looked for libheif.so in the usual directories (e.g., /usr/lib, etc.) and failed to find.

However, I search on my hard drive and found that my system *does* have libheif.so.1.12.0, and its location is one of the directories being searched (/lib/x86_64-linux-gnu/). Furthermore, there is a soft link from libheif.so.1.12.0 to libheif.so.1 (in the same directory). So I made a soft link from libheif.so.1.12.0 to libheif.so (in the same directory) and - voilà! - xnconvert detects my heic files as valid images!

Rather than delete my post, I thought I'd send it in case anyone with a similar problem stumbles upon it.

Also - I do have a follow up question...

*why* did I have to do this??? Specifically, what controls whether an ELF file searches for a library file that ends in a version number (e.g., libheif.so.1.12.0) in addition to the plain vanilla "*.so" (e.g. libheif.so)? Is this a function of how the image is built? Or is it controlled externally by my OS?

It doesn't make sense (to me) if it were the latter - because I have other programs that do successfully load libraries that end in "*.so.1" (as well as .5, .6, etc.), so my OS doesn't seem to be the road block.