Viewing HEIC (HEIF) Images on Pop! OS 22.04
Today I was blindsided by the existence of HEIC images, because I don’t often receive images from iPhone/iPad users. Since Pop!_OS is still running Ubuntu 22.04, I not only didn’t have the library I needed to view these images, but when I found the library I needed, the standard package manager had an out-of-date version for the images I was trying to view. It took an hour of stumbling around to track down a solution.
The Solution
Install the latest version of the libheif
package from the Ubuntu PPA.
$ sudo add-apt-repository ppa:strukturag/libheif
$ sudo nala install libheif1 heif-gdk-pixbuf heif-thumbnailer
The Symptom
I couldn’t open the HEIC images using eog
, but I could open them using GIMP. I wanted to convert the images in bulk to JPG, so I didn’t stop at using GIMP to convert the images one by one using the UI.
Attempt 1
I tried to install heif-gdk-pixbuf
, but then neither magick
nor eog
could read the image. I got this error message:
Could not read HEIF/AVIF file: Invalid input: Unspecified: Metadata not correctly assigned to image
This is how I learned that the version (1.12) of libheif
that ships (as of the date of writing this) in the Ubuntu package manager can’t read HEIC images taken on iOS 18. I needed to install the latest version (1.19.8) from the Ubuntu PPA listed in the solution.
Now I can receive images from my friends who use iOS 18 and, so far, all the image tools I use can read the images without issue.