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

tsreyb
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.
schnauss
Posts: 1
Joined: Tue Nov 07, 2023 9:43 am

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

Post by schnauss »

Thank you! You save my time.
brst
Posts: 3
Joined: Thu Jan 11, 2024 11:09 am

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

Post by brst »

You need to install libheif-dev to get reading HEIC/HEIF files to work. For me, it was also a long journey of trial and error......

Code: Select all

apt install libheif-dev
libheif1 does not work for me. I have Linux Mint 21.2.
Greetings