mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kimgio: webp without alpha writing fix
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
59f5511719
commit
7807328cd8
1 changed files with 3 additions and 2 deletions
|
@ -48,7 +48,8 @@ bool WebPHandler::read(QImage *retImage)
|
|||
QByteArray data = device()->readAll();
|
||||
|
||||
WebPBitstreamFeatures features;
|
||||
const VP8StatusCode ret = WebPGetFeatures(reinterpret_cast<const uint8_t*>(data.constData()), data.size(), &features);
|
||||
const VP8StatusCode ret = WebPGetFeatures(reinterpret_cast<const uint8_t*>(data.constData()),
|
||||
data.size(), &features);
|
||||
if (ret != VP8_STATUS_OK) {
|
||||
return false;
|
||||
}
|
||||
|
@ -109,7 +110,7 @@ bool WebPHandler::write(const QImage &image)
|
|||
if (image.hasAlphaChannel()) {
|
||||
size = WebPEncodeRGBA(imageData, image.width(), image.height(), image.width() * 4, quality, &output);
|
||||
} else {
|
||||
size = WebPEncodeRGB(imageData, image.width(), image.height(), image.width() * 4, quality, &output);
|
||||
size = WebPEncodeRGB(imageData, image.width(), image.height(), image.width() * 3, quality, &output);
|
||||
}
|
||||
delete []imageData;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue