Bug 422732 - AVIF image support in khtml
Summary: AVIF image support in khtml
Status: RESOLVED UNMAINTAINED
Alias: None
Product: frameworks-khtml
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Other
: NOR wishlist
Target Milestone: ---
Assignee: Martin Sandsmark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-10 10:21 UTC by dnovomesky
Modified: 2023-07-03 20:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dnovomesky 2020-06-10 10:21:15 UTC
Hello,

I am author of github.com/novomesk/qt-avif-image-plugin

AVIF is a new image format based on AV1 compression. Firefox has support for AVIF (but disabled by default), Google is working to add support into Chrome.

Even before Firefox, Konqueror was able to display AVIF in websites after following trivial patch in khtml:
www.reddit.com/r/AV1/comments/faayy9/avif_image_browser_test/

I propose following changes in src/imload/decoders/qimageioloader.cpp:

1)
In bool isSupportedFormat(QString format)
Check if AVIF is listed in QImageWriter::supportedImageFormats()
and mark AVIF as supported (return true).

2)
In bool imageFormat(QImage &image, ImageFormat &format)
in default switch case - instead assuming "unsupported formats", what about converting them to supported?

if ( image.hasAlphaChannel() ) {
  image = image.convertToFormat( QImage::Format_ARGB32 );
  format.type  = ImageFormat::Image_ARGB_32_DontPremult;
}
else {
  image = image.convertToFormat( QImage::Format_RGB32 );
  format.type  = ImageFormat::Image_RGB_32;
}

AVIF test files here:
github.com/AOMediaCodec/av1-avif/tree/master/testFiles
Comment 1 Christoph Feck 2020-07-08 17:27:03 UTC
As far as I know, the ability to use the KHTML part in Konqueror was removed, leaving only the QtWebEngine part.
Comment 2 Christoph Cullmann 2023-07-03 20:17:43 UTC
KHTML was already in pure maintenance mode in kf5, for kf6 it got removed, there will be no future work spend on this beside critical security issues, if at all.