Bug 468884 - Can't open some self-made libaom avif photos anymore; sxiv opens them with no problem
Summary: Can't open some self-made libaom avif photos anymore; sxiv opens them with no...
Status: RESOLVED UPSTREAM
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.105.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2023-04-23 23:14 UTC by John
Modified: 2023-08-30 14:09 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Gwenview and Dolphin Fail on This Self Made Avif Photo. Sxiv opens it with no problem. (505.28 KB, image/avif)
2023-04-23 23:14 UTC, John
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John 2023-04-23 23:14:38 UTC
Created attachment 158377 [details]
Gwenview and Dolphin Fail on This Self Made Avif Photo. Sxiv opens it with no problem.

SUMMARY
***
Gwenview can open some avif made photos, but on some it fails to open. Dolphin can't generate thumbnail. Sxiv has no problem at all.
***

STEPS TO REPRODUCE
1. Make a photo with Nicon D810 [tiff, 7380x4928]
2. Import with dcraw [9.28]
3. Convert it to intermediary PNG with graphicsmagic [$ gm convert]
4. Compress your PNG photo to avif [av1] with libaom:
$ avifenc -c aom -j all -d 8 -s 0 --sharpyuv -a aq-mode=2 -a sharpness=0 myphoto.png -o myphoto_compressed.avif
5. Result: Size reduction from 209M [tif]/164M [png] to 506K [avif].
 

OBSERVED RESULT
1. Dolphin has no thumbnail [unlike my other slef-made avif photos]
2. Gwenview can't open this avif photo
3. sxiv has absolutely zero problem with this photo

EXPECTED RESULT
Stop adding endless functions to gwenview. Focus on photo displaying. Make it high quality photo viewer just like sxiv. Do one thing, one thing only and do it good. Gwenview should be photo viewer not editor. Its not GIMP nor Darktable. Make it robust photo viewer.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Arch (not manjaro)
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105
Qt Version: 5.15.9

ADDITIONAL INFORMATION
not sure if needed, but:
ffmpegthumbs: 23.04
kimageformats: 5.105
libaom 3.6.0
Comment 1 Nate Graham 2023-04-24 19:09:17 UTC
Can confirm that image doesn't open. I see a number of recent changes to AVIF support recently in https://invent.kde.org/frameworks/kimageformats/-/commits/master, so it could very well be a regression. I'm moving the bug to the kimageformats framework and CCing some of the people who touched AVIF support recently.
Comment 2 Joshua Goins 2023-04-24 19:13:53 UTC
Are you sure sxiv is not allowing invalid AVIF files? At least on my machine, neither Firefox or Chromium can load your attached AVIF (Firefox just refuses, Chromium just loads a gray image)
Comment 3 Joshua Goins 2023-04-24 19:20:09 UTC
It seems avifdec doesn't like your image either, so I would guess your file is the problem. I tested your same command on local images and those decode fine in Gwenview. Maybe you didn't upload the whole file to Bugzilla?
Comment 4 Mirco Miranda 2023-04-24 21:29:08 UTC
I tried the attached image on some programs:
- [Linux] - kde avif plugin won't open it (v5.103)
- [Linux] - gimp doesn't open it (v2.10.34)
- [Linux and Windows] - chrome opens it (gray image 7380x4928px, don't know if that's right: the name of image is "lake")
- [Linux] - Sxiv doesn't open it (v26 on Debian unstable -> sxiv: lake [biased sharpness].avif: Error opening image)
- [Windows] - Microsoft Photo with AV1 codec installed tells me that the image is wrong

On the 26th, when I get back to work, I'll also try Photoshop (both Mac and Windows). 

I can't tell if it's a valid avif or not, it's definitely not a common avif.
Comment 5 Joshua Goins 2023-04-25 14:43:05 UTC
Interesting that your version of sxiv doesn't open it, sxiv on Arch (version 26-1) can open it
Comment 6 Mirco Miranda 2023-04-26 11:03:14 UTC
(In reply to Joshua Goins from comment #5)
> Interesting that your version of sxiv doesn't open it, sxiv on Arch (version
> 26-1) can open it

It probably depends on the version of libimlib2 used.

In any case, even with Photoshop I can't open the attached file.
Comment 7 dnovomesky 2023-04-30 14:57:53 UTC
Temporary workaround to open image is to rebuild libavif with dav1d decoder disabled and libaom support enabled.
Comment 8 dnovomesky 2023-05-02 10:09:20 UTC
My recommendation in order to reach better compatibility is to use --tilecolslog2 2 parameter for the image.

avifenc -j 4 -s 0 -d 8 --tilecolslog2 2  -o lake_new.avif myphoto.png

The result (lake_new.avif) should work everywhere. The --tilecolslog2 2 splits the image into 4 tiles and it works with other decoders.
The libavif and libaom developers knows about the problem.
Comment 9 John 2023-08-30 13:37:34 UTC
Its now fixed with "-2" of kimageformats (new compilation).