Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 940915 - media-gfx/gimp-2.10.38 cannot open avif files with >=media-libs/libheif-1.18.0
Summary: media-gfx/gimp-2.10.38 cannot open avif files with >=media-libs/libheif-1.18.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Sergey Torokhov
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-10-05 21:08 UTC by fcrvincent
Modified: 2024-10-18 15:55 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fcrvincent 2024-10-05 21:08:05 UTC
When trying to open any avif image file, gimp returns the message: unknown file type.

Gimp's compiled with the heif use flag: 

media-gfx/gimp
Installed versions:  2.10.38(0/2)^t(12:44:20 05/10/24)(alsa heif mng udev webp -aalib -aqua -debug -doc -gnome -jpeg2k -jpegxl -openexr -postscript -test -unwind -vector-icons -wmf -xpm CPU_FLAGS_PPC="-altivec" CPU_FLAGS_X86="mmx sse")

and 

media-libs/libheif
Installed versions:  1.18.1(0/1.18)^t(17:25:21 05/10/24)(aom gdk-pixbuf rav1e svt-av1 threads x265 -go -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")

At the same time imagemagick with the heif use flag properly decodes the same avif files (for example with magick display file.avif)


Any clue how to get gimp to decode avif?
Comment 1 Sergey Torokhov 2024-10-16 12:47:06 UTC
Sorry for long delay. I checked it and could confirm that Gimp-2.10.38 being built against media-libs/libheif-1.18.1 can't open(export) and save(import) heif and avif images. 

While successfully does it being build against media-libs/libheif-1.15.2-r1(0/1.12) and configuration with it also states:

Optional Plug-Ins:
...
  HEIC:                      import: yes - export: yes [profile support: yes]
  AVIF:                      import: yes - export: yes
...

and with libheif-1.18.1(0/1.18) the configuration is:

Optional Plug-Ins:
...
  HEIC:                      import:  - export:  [profile support: no]
  AVIF:                      import:  - export: 
...
(addition of USE="x265" or USE="svt-av1" have no affect).

So the quickest workaround is use media-libs/libheif-1.15.2-r1.


Also the gimp-2.99.18-r1 seems has no problem with libheif-1.18.1:
Comment 2 fcrvincent 2024-10-16 13:16:57 UTC
Thanks for that. 

I'll probably wait for gimp 99 to become stable or heif to upgrade to a compatible version (gimp's ebuild suggest >=media-libs/libheif-1.9.1)

Because one of my packages (may be imagemagick) does require heif >= 1.18.1
Comment 3 Sergey Torokhov 2024-10-16 17:02:17 UTC
I was out of my gentoo pc last week so I need to check what was the difference between libheif-1.15.2 and 1.18.1: the gimp-2.10.38 founds both of them in the system but for newest one doesn't add support for heif/avif export/import.
Comment 4 fcrvincent 2024-10-16 18:35:36 UTC
Thanks. That's indeed strange that a package named heif no longer supports the heif format.
Comment 5 Sergey Torokhov 2024-10-16 21:25:32 UTC
The libheif dropped autotools support since 1.8.0 version with removing additional variables from libhief.pc file that were used by gimp confugure.ac confuguration to check if export/import is supported.

I could try to make unconditionaly set heif export/import for gimp-2.10.38 if libheif is presented. I built gimp-2.10.38 against libheif-1.15 2 and then just update to 1.18.1  without gimp rebuild and heif/avif files are opened. So there is only configuration problem.
Comment 6 fcrvincent 2024-10-16 21:44:57 UTC
This should work yes.
You could also have a look at how gimp 2.99.18-r1 does it and borrow their approach if feasible.
Comment 7 Larry the Git Cow gentoo-dev 2024-10-18 12:39:20 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4b9f72802b4d4be021e6fa77198c5d3d0d1a4d1

commit b4b9f72802b4d4be021e6fa77198c5d3d0d1a4d1
Author:     Sergey Torokhov <torokhov-s-a@yandex.ru>
AuthorDate: 2024-10-17 14:08:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-10-18 12:25:00 +0000

    media-gfx/gimp: gimp-2.10.x, fix media-libs/libheif-1.18 compat
    
    Closes: https://bugs.gentoo.org/940915
    Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
    Closes: https://github.com/gentoo/gentoo/pull/39017
    Signed-off-by: Sam James <sam@gentoo.org>

 ...mp-2.10_libheif-1.18_unconditional_compat.patch | 23 ++++++++++++++++++++++
 ...mp-2.10.34-r2.ebuild => gimp-2.10.34-r3.ebuild} |  6 +++++-
 ...{gimp-2.10.36.ebuild => gimp-2.10.36-r3.ebuild} |  6 +++++-
 ...mp-2.10.36-r2.ebuild => gimp-2.10.36-r4.ebuild} |  6 +++++-
 ...{gimp-2.10.38.ebuild => gimp-2.10.38-r1.ebuild} |  4 ++++
 5 files changed, 42 insertions(+), 3 deletions(-)
Comment 8 fcrvincent 2024-10-18 15:55:40 UTC
Excellent; working perfectly. 
Thanks