chafa icon indicating copy to clipboard operation
chafa copied to clipboard

"Unknown file format" when using stdin for AVIF on Linux

Open ndren opened this issue 3 years ago • 1 comments

Running the following works: chafa lisa.avif cat lisa.avif | chafa /dev/stdin # this is a bashism The following does not work: cat lisa.avif | chafa cat lisa.avif | chafa - This is not because of the file extension itself as removing it makes no difference. lisa.avif.tar.gz

ndren avatar Sep 04 '22 14:09 ndren

Hi, thanks for reporting this.

AVIF is handled by the generic ImageMagick-based loader, and it needs a workaround to handle situations where chafa already processed stdin looking for headers etc. Since ImageMagick support is going away soon, I'm a little torn on whether this is worth doing. It'd be better to add a native AVIF loader instead.

hpjansson avatar Sep 06 '22 00:09 hpjansson

I'm interested in avif as it is excellent for small files. I've been using heifg-enc and avifenc. Cannot decide which is better. Both generate files that chafa loads with wrong colors btw .

clort81 avatar Jan 29 '23 12:01 clort81

I'll see if I can prioritize an AVIF loader. I'd love to have a test case or two that come up with wrong colors currently.

hpjansson avatar Jan 29 '23 20:01 hpjansson

(A native AVIF loader will also solve the stdin problem).

hpjansson avatar Jul 14 '23 23:07 hpjansson

I have it this chafa limitation when browsing on https://arne.me/articles/emacs-from-scratch-part-one-foundations/ with offpunk.

ploum avatar Dec 22 '23 17:12 ploum

Ok. Will have to do this for the next milestone.

hpjansson avatar Dec 23 '23 00:12 hpjansson

No urgency. It is the first time I encounter this format in the wild.

Also, I’ve implemented a quick workaround: if chafa fails to open a picture, offpunk fallsback to timg.

ploum avatar Dec 23 '23 11:12 ploum

Just realized I already added native AVIF support (see #157), but overlooked this issue. It works for me on master, fix will be in 1.14.0!

hpjansson avatar Dec 29 '23 14:12 hpjansson