Bug 422732

Summary: AVIF image support in khtml
Product: [Frameworks and Libraries] frameworks-khtml Reporter: dnovomesky
Component: generalAssignee: Martin Sandsmark <martin.sandsmark>
Status: RESOLVED UNMAINTAINED    
Severity: wishlist CC: christoph, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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.