Bug 6634

Summary: Unable to open HEIC file from Gimp
Product: Fedora Reporter: giun7a
Component: libheif-freeworldAssignee: Dominik 'Rathann' Mierzejewski <dominik>
Status: RESOLVED INVALID    
Severity: major CC: leigh123linux, zebob.m
Priority: P1    
Version: f37   
Hardware: x86_64   
OS: GNU/Linux   
URL: https://gitlab.gnome.org/GNOME/gimp/-/issues/9395
namespace:
Attachments: Sample image.

Description giun7a 2023-04-13 11:31:55 CEST
Hi,
with the latest libheif (1.15.1) I'm unable to open HEIC file using Gimp (2.10.32), but it works with the previous version 1.13.0:

Not working version:

$ sudo dnf --enablerepo=rpmfusion-free-updates-testing install libheif-freeworld
$ rpm -qa libheif\*
libheif-1.15.1-2.fc37.x86_64
libheif-freeworld-1.15.1-3.fc37.x86_64


Working version:

$ sudo dnf downgrade libheif --allowerasing
...
$ rpm -qa libheif\*
libheif-1.13.0-1.fc37.x86_64


Thanks
Comment 1 leigh scott 2023-04-13 12:53:04 CEST
The pre-split libheif-1.15.1 packages works fine.

https://koji.rpmfusion.org/koji/buildinfo?buildID=24897


I have orphaned gimp-heif-plugin as I no interest in fixing the mess caused by fedora libheif split.

https://admin.rpmfusion.org/pkgdb/package/free/gimp-heif-plugin/
Comment 2 giun7a 2023-04-13 13:43:24 CEST
(In reply to leigh scott from comment #1)
> The pre-split libheif-1.15.1 packages works fine.
> 

yes, it works: I'm able to open HEIC files in GIMP and in Gnome Image Viewer with the pre-split package

> 
> I have orphaned gimp-heif-plugin as I no interest in fixing the mess caused
> by fedora libheif split.

Bad news :-(


Installing the new package 'heif-pixbuf-loader' I'm able to open HEIC in Gnome Image Viewer:

$ rpm -qa \*heif\*
libheif-1.15.1-2.fc37.x86_64
heif-pixbuf-loader-1.15.1-2.fc37.x86_64
libheif-freeworld-1.15.1-3.fc37.x86_64

but it still doesn't work in GIMP :-(

$ rpm -qa \*gimp\*
gimp-libs-2.10.32-3.fc37.x86_64
gimp-2.10.32-3.fc37.x86_64
gimp-heif-plugin-1.1.0-12.fc37.x86_64
Comment 3 leigh scott 2023-04-13 14:21:25 CEST
Maybe gimp could enable heif to replace gimp-heif-plugin.

https://github.com/GNOME/gimp/blob/gimp-2-10/configure.ac#L1812
Comment 4 Dominik 'Rathann' Mierzejewski 2023-04-13 14:45:18 CEST
Looks like the crash in heif plugin is fixed in 1.15.2. More info at:

https://github.com/strukturag/libheif/issues/151
https://github.com/strukturag/libheif/commit/bbd37560cc411db2fac4f7b92c038326a1b44ae1
https://gitlab.gnome.org/GNOME/gimp/-/issues/4185

(In reply to leigh scott from comment #3)
> Maybe gimp could enable heif to replace gimp-heif-plugin.
> 
> https://github.com/GNOME/gimp/blob/gimp-2-10/configure.ac#L1812

You are absolutely right. We don't need a separate package here.

https://bugzilla.redhat.com/show_bug.cgi?id=2186478 filed.
Comment 5 leigh scott 2023-04-18 14:18:02 CEST
Created attachment 2495 [details]
Sample image.

This image fails to open in gimp-2:2.10.34-1.fc38.x86_64
It opens fine using eom
Comment 6 Dominik 'Rathann' Mierzejewski 2023-04-24 09:29:38 CEST
Yes, I can reproduce and I'm looking into it. It looks like newer libheif requires explicit calling heif_init/heif_deinit to load codecs compiled as plugins. See https://github.com/strukturag/libheif/issues/825 .
Comment 7 Dominik 'Rathann' Mierzejewski 2023-04-24 12:22:37 CEST
Upstream issue opened. It looks like GIMP is detecting available codecs at build time. :(
Comment 8 Dominik 'Rathann' Mierzejewski 2023-04-25 13:03:16 CEST
So, upstream provided a fix in https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/905 that works for me. I've asked the gimp maintainers to include it: https://bugzilla.redhat.com/show_bug.cgi?id=2189462 .

Closing the bug here as the bug is in gimp, not libheif.