5

I upgraded from Kubuntu 20.10 to 21.04. According to the answer at Any app on Ubuntu to open and/or convert HEIF pictures (.HEIC, High Efficiency Image File Format)? support for HEIC/HEIF is a part of KDE Frameworks 5.80, which is included in Kubuntu 21.04. Similar information is seen from the KDE Frameworks 5.80.0 release annoucement.

Nevertheless, after upgrading to 21.04, I can neither get thumbnails of HEIC images in Dolphin, nor can I open them in either Gwenview or Kdenlive. The only support continues to be similar to that before the upgrade, namely in GIMP and DigiKam. Strangely enough, a folder of HEIF/HEIC images does have some sort of thumbnail in Dolphin. But not the individual images. Right clicking on one only offers GIMP as an option to open it with. When I nevertheless try opening in Gewnview, the error message reads, "Loading 'so-and-so.heic' failed. Gwenview cannot display documents of type image/heif." When trying to add one to a Kdenlive project, the message reads, "Cannot open file so-and-so.heic."

Suggestions, please? Why can I not open HEIC/HEIF images?

EDIT: I don't know if it makes a difference, but the arch page for kimageformats 5.82.0-1 lists libheif as an optional dependency. The closest Ubuntu package is libheif1, which is installed for me, yet the Ubuntu package of kimageformat-plugins seems to have no equivalent dependency.

007
  • 145
  • The release announcement says a plugin was added. Do you have the kimageformat-plugins package installed? (It's in universe, so I don't think it's installed by default). – muru May 13 '21 at 08:54
  • It's already installed. I checked in muon before posting. – 007 May 13 '21 at 11:00
  • 1
    Answer to your question in your comment on the other question: I don't know as I don't use Kubuntu. The Kubuntu Release Notes don't reveal much, it says "KDE Apps updates, including 20.12.3 release service and other updated apps", just it say "including 21.04 ..." to include KDE Gear 21.04. – Filbuntu May 13 '21 at 14:26
  • 1
  • You can update to KDE Plasma 5.21.5 with KDE Frameworks 5.81.0 in (K)Ubuntu 21.04 via PPA, maybe this will help. – Filbuntu May 15 '21 at 15:02
  • @Filbuntu Upgraded. Confirmed via kinfocenter that KDE Frameworks Version is 5.81.0 and KDE Plasma version is 5.21.5. Yet the situation with HEIF/HEIC images is unchanged. No thumbnails in Dolphin, can't open in Gwenview or Kdenlive. – 007 May 16 '21 at 11:17
  • @007 This is a pity and strange, not according to the announcement. Although it seems you should not need to do so: Have you tried to install the package heif-gdk-pixbuf: sudo apt install heif-gdk-pixbuf? Maybe even with the PPA (see other HEIC question) to get the latest version. – Filbuntu May 16 '21 at 17:27
  • @Filbuntu It wasn't. I installed it. No change. Also tried ppa:strukturag/libheif. Other ppa doesn't yet support Hirsute. But even after upgrading with the help of the libheif PPA, no change. Still can't view HEIF/HEIC files in Kdenlive, Gwenview. As you say, very strange. Release notes for KDE Frameworks 5.80 definitely indicate support for the format. – 007 May 17 '21 at 14:05
  • @007 Hmm, strange indeed. I am at my wit's end. Maybe the release notes were too hopeful. Perhaps you can contact somebody of the KDE team or post a question in a KDE specific forum. So far no KDE guy replied or commented here, unfortunately. As you surely know, you could use another app listed in the answer of the other question till this is sorted out. If you will find out more please feed it back here, thanks! – Filbuntu May 17 '21 at 14:26
  • Been using libheif-examples to convert to jpg, as mentioned in your excellent answer to the other question. Was hoping to avoid the extra step after the upgrade to hirsute, hence this question when the upgrade didn't provide the reported feature. Will mention here as and when a solution is found. Thanks for the help! – 007 May 18 '21 at 10:23
  • @007 Any update? Does it work now? – Filbuntu Oct 27 '21 at 16:07

3 Answers3

5

Unfortunately, HEIF images are still not supported in KDE Plasma / Gwenview as of Kubuntu 21.10 (and even Plasma 5.23 from the backports ppa), because the package kimageformat-plugins is compiled without HEIF support by default.

The support flag is not enabled yet in the default (K)ubuntu packages. There is a pending bug on launchpad "kimageformat-plugins should be built with HEIC / HEIF support” regarding this, please indicate that it also affects you and comment if needed.

I just managed to view HEIF images in Gwenview by recompiling the kimageformat-plugins package (I'm not a DEB expert, it is the first time I recompiled a DEB package, so please correct me if I'm doing something wrong, but it did work for me tonight):

[Update]: there is now a short bash script for the below mentioned recompiling steps you can just copy&paste and call after every package update available at https://superuser.com/a/1713233/196387 . Just use that an be happy! [/Update]

  1. Make sure deb-src lines are enabled /etc/apt/sources.list and /etc/apt/sources.list.d/kubuntu-ppa-ubuntu-backports.list (if you use the backports ppa with the latest KDE software)

  2. Install dependencies:

sudo apt-get install build-essential devscripts
sudo apt build-dep kimageformat-plugins
sudo apt install libheif-dev
  1. Create a directory somewhere, pull the package source into it and cd into the source directory kimageformats-5.xx.x within the new directory:
mkdir kimageformats-build
cd kimageformats-build
apt source kimageformat-plugins
cd kimageformats-5.*
  1. Edit the file CMakeLists.txt in this directory: In the line which says option(KIMAGEFORMATS_HEIF "Enable plugin for HEIF format" OFF) change OFF to ON

  2. Rebuild the package with debuild -us -uc -b

  3. Go into the parent directory (cd ..), there should be new .deb file called something like kimageformat-plugins_5.xx.**.deb (in my case today it was kimageformat-plugins_5.88.0-0ubuntu1~ubuntu21.10~ppa1_amd64.deb). Install that package by sudo apt install --reinstall ./kimageformat-plugins_5.*.deb

  4. As @user1421503 said in his answer: Edit /usr/share/kservices5/imagethumbnail.desktop and add image/heif to the line which begins with MimeType=

Enjoy viewing your iPhone images in Gwenview!

wasinger
  • 151
  • I was able to use the instruction posted by Wasinger (thanks) to get heic working. Some modifications were required on the Kubuntu 22.04.1 installation. Step 1 : deb-src lines - I need to uncomment ALL deb-src lines in 1 file /etc/apt/sources.list, but a "sudo apt-get update" is required, or it still complains of missing deb-src entries. Step 6 : "sudo apt install --reinstall ./kimageformat-plugins_5..deb" did not work for me. Error message is '-reinstall' option is not understood in combination with other options. What worked for me is "sudo apt reinstall ./kimageformat-plugins_5..deb" – Ham Oct 26 '22 at 13:36
  • Top instructions! thank you – br1 Sep 30 '23 at 11:48
  • It worked! Anyway, are you sure devscripts is needed? – Marco Sulla Nov 25 '23 at 21:21
1

HEIF plug-in is included in kimageformats package but package maintainer has to explicitly enable it (use cmake with -DKIMAGEFORMATS_HEIF=ON). Otherwise the plug-in will not be built/installed (check if you have kimg_heif.so).

There is a pending bug on launchpad "kimageformat-plugins should be built with HEIC / HEIF support” regarding this, please indicate that it also affects you and comment if needed.

The plug-in needs libheif>=1.10.0 build with libde265 support.

If you have the kimg_heif.so installed, you can modify following file to enable HEIF/HEIC thumbnails:

/usr/share/kservices5/imagethumbnail.desktop

add image/heif to the line which begins with MimeType=

Filbuntu
  • 13,021
  • 37
  • 88
  • 112
1

I was just trying to open a bunch of *.heic images, and found this question when neither Dolphin nor Gwenview could load them.

Luckily there is good news: just 'do-release-upgrade' to 22.10 (kinetic) and HEIC support is in (see https://bugs.launchpad.net/ubuntu/+source/kimageformats/+bug/1951278/comments/5).

nagelp
  • 413