r/archlinux • • 27d ago

SUPPORT magick doesn't work with .avif files despite libavif and libheif installed. What to do?

[user@host Downloads]$ ls
freddy.avif
[user@host Downloads]$ magick freddy.avif freddy.png
magick: no decode delegate for this image format `freddy.avif' @ error/constitute.c/ReadImageInternal/739.
[user@host Downloads]$ pacman -Q libavif libheif
libavif 1.4.2-1
libheif 1.23.7-1
16 Upvotes

13 comments sorted by

17

u/BOZAYIBOGAN 27d ago edited 27d ago

FOUND THE PROBLEM! IT'S TURKISH LETTER I CASEFOLDING AGAIN!!! A TEXTBOOK CASE!

Turkish

I ı /ɯ/: eleventh letter of Turkish alphabet
"I": Latin Capital Letter I (U+0049)
"ı": Latin Small Letter Dotless I (U+0131)

İ i /i/: twelfth letter of Turkish alphabet
"İ": Latin Capital Letter I with Dot Above (U+0130)
"i": Latin Small Letter I (U+0069)

English

I i /aɪ/: ninth letter of English alphabet
"I": Latin Capital Letter I (U+0049)
"i": Latin Small Letter I (U+0069)

So HEIC becomes heıc.

EDIT: This is a bug. To reproduce, run LC_CTYPE=tr_TR.UTF-8 magick input.avif output.png.

10

u/Julien12150 26d ago

additional instruction in order to reproduce the bug for everyone else: you need to install turkish locales in /etc/locale.gen and then run locale-gen, otherwise the app will never actually become aware of turkish casefolding and the bug won't trigger.

doing this I managed to get the same error.

1

u/qqyy 26d ago

I'm not following how this is a bug. running LC_CTYPE=tr_TR.UTF-8 magick input.avif output.png works for me. Even if I change the filename to use .heıc.

1

u/spryfigure 27d ago

What's magick identify -list format saying?

-4

u/BOZAYIBOGAN 27d ago

Comment cannot exceed 10000 characters

2

u/Illustrious-Gur8335 27d ago

You could always pastebin

4

u/spryfigure 27d ago edited 27d ago
magick identify -list format | grep -i avif

or better,

magick identify -list format | grep -i heic

1

u/BOZAYIBOGAN 27d ago

OK, neither command returned anything

1

u/spryfigure 27d ago

Then your install is broken. You want to see something like

     AVCI  HEIC      ---   AVC Image File Format (1.23.7)
     AVIF  HEIC      rw+   AV1 Image File Format (1.23.7)
     HEIC  HEIC      rw+   High Efficiency Image Format (1.23.7)
     HEIF  HEIC      rw+   High Efficiency Image Format (1.23.7)

Try to fix it, or reinstall Imagemagick.

0

u/BOZAYIBOGAN 27d ago

sudo pacman -S imagemagick libavif libheif --overwrite '*' didn't help. Great, just wanted to crop Freddy Fazbear's photo for pp!

3

u/Hamilton950B 27d ago

Works for me.

% pacman -Qs magick
local/imagemagick 7.1.2.35-1
    An image viewing/manipulation program
% pacman -Qs avif
local/libavif 1.4.2-1
    Library for encoding and decoding .avif files
local/libheif 1.23.7-1
    An HEIF and AVIF file format decoder and encoder
% magick identify -list format | grep -i heic
    AVCI  HEIC      rw+   AVC Image File Format (1.23.7)
    AVIF  HEIC      rw+   AV1 Image File Format (1.23.7)
    HEIC  HEIC      rw+   High Efficiency Image Format (1.23.7)
    HEIF  HEIC      rw+   High Efficiency Image Format (1.23.7)

2

u/spryfigure 27d ago

I downloaded a avif test file to make sure that it works here, my pacman -Q libavif libheif is the same as yours.

When I run

magick ~/tmp/mountain-landscape.{avif,png}

I get a converted png image from the avif file. It's something only on your system. Maybe reinstall imagemagick and libavif and libheif?