kimgio: blend framas with the last one that is not to be blended in webp plugin

assuming frame is to be blended then that means it is partial data, if it is
not to be blended it has to be complete image

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-10 06:41:56 +03:00
parent 08154cd8c1
commit 810f624622

View file

@ -122,9 +122,8 @@ bool WebPHandler::read(QImage *image)
switch (webpiter.blend_method) {
case WEBP_MUX_BLEND: {
if (Q_UNLIKELY(m_lastframe.isNull())) {
kWarning() << "Last frame is null";
} else {
// NOTE: there are bogus images that want to blend all frames, including the first one
if (!m_lastframe.isNull()) {
QPainter p(image);
// TODO: offsets (webpiter.x_offset and webpiter.y_offset)
p.setCompositionMode(QPainter::CompositionMode_DestinationOver);
@ -134,6 +133,7 @@ bool WebPHandler::read(QImage *image)
break;
}
case WEBP_MUX_NO_BLEND: {
m_lastframe = *image;
break;
}
default: {
@ -146,7 +146,6 @@ bool WebPHandler::read(QImage *image)
if (m_currentimage >= m_imagecount) {
m_currentimage = 0;
}
m_lastframe = *image;
WebPDemuxReleaseIterator(&webpiter);
WebPAnimDecoderDelete(webpanimdec);