kimgio: fill the webp buffer with transparent color

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-10 09:49:42 +03:00
parent f07799521f
commit cbbf7a75e5

View file

@ -83,11 +83,13 @@ bool WebPHandler::read(QImage *image)
m_loopcount = webpaniminfo.loop_count;
m_imagecount = webpaniminfo.frame_count;
QImage buffer(webpaniminfo.canvas_width, webpaniminfo.canvas_height, QImage::Format_ARGB32);
QImage buffer(webpaniminfo.canvas_width, webpaniminfo.canvas_height, QImage::Format_ARGB32_Premultiplied);
if (Q_UNLIKELY(buffer.isNull())) {
kWarning() << "Could not create buffer image";
return false;
}
// NOTE: have to fill, areas of frames may not be drawn
buffer.fill(Qt::transparent);
QRectF previousrect;
QPainter painter(&buffer);