https://bugs.kde.org/show_bug.cgi?id=422732

            Bug ID: 422732
           Summary: AVIF image support in khtml
           Product: frameworks-khtml
           Version: unspecified
          Platform: Other
                OS: Other
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: martin.sandsm...@kde.org
          Reporter: dnovome...@gmail.com
                CC: kdelibs-b...@kde.org
  Target Milestone: ---

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

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to