avif images created using imagemagick doesn't display on qt app using kde-frameworks/kimageformats qt plugins this is because imagemagick create yuv420 images, when libavif does only support yuv422 natively, and require libyuv to decode other formats https://invent.kde.org/frameworks/kimageformats/-/issues/8 Reproducible: Always Steps to Reproduce: 1. install requirements kimageformats, nomacs or kolourpaint 2. convert a portrait image (don't know why but landscape image works, maybe an issue of image size?) using imagemagick `convert image.jpg image.avif` 3. try to open it with nomacs or kolourpaint Actual Results: image is not decoded (libheif based app does decode the file) Expected Results: the file should be displayed using avifdec libavif tool the error displayed is : avifImageScale() called, but is unimplemented without libyuv! didn't found any libyuv ebuild information... so a libyuv package should be created and libavif must have a dependency on it
The root of the problem is bug in older libheif. Problem is with rotated images and that width and heigh are swapped. Firefox reject such images and Google Chrome apply unexpected scaling so that picture looks differently as intended. We have 1.15.2 version in Gentoo, that version has the bug. But after manually building libheif, the AVIF files with rotation are created correctly. Rotated AVIF created using libheif-1.15.2 are not correct. Enabling libyuv would help to display them, but the scaling (like what Chrome uses) would be performed, it would look much differently than original (because of swapped with and height after rotation). I recommend to upgrade libheif when possible and to re-generate the AVIF files again afterwards.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c464dd0cff8f5e72a1160b45eec2a1caa4523b7b commit c464dd0cff8f5e72a1160b45eec2a1caa4523b7b Author: NRK <nrk@disroot.org> AuthorDate: 2025-03-07 15:26:50 +0000 Commit: Yixun Lan <dlan@gentoo.org> CommitDate: 2025-03-19 02:56:08 +0000 media-libs/libavif: add v1.2.0 and libyuv useflag Closes: https://bugs.gentoo.org/916948 Signed-off-by: NRK <nrk@disroot.org> Signed-off-by: Yixun Lan <dlan@gentoo.org> media-libs/libavif/Manifest | 1 + media-libs/libavif/libavif-1.2.0.ebuild | 113 +++++++++++++++++++++++++++ media-libs/libavif/libavif-9999.ebuild | 9 +-- media-libs/libavif/metadata.xml | 1 + profiles/arch/alpha/package.use.mask | 4 + profiles/arch/arm/package.use.mask | 4 + profiles/arch/arm64/package.use.mask | 4 + profiles/arch/hppa/package.use.mask | 4 + profiles/arch/loong/package.use.mask | 4 + profiles/arch/mips/package.use.mask | 4 + profiles/arch/powerpc/ppc64/package.use.mask | 4 + profiles/arch/riscv/package.use.mask | 4 + profiles/arch/sparc/package.use.mask | 4 + profiles/arch/x86/package.use.mask | 4 + 14 files changed, 159 insertions(+), 5 deletions(-)