mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kimgio: write mask from ico plugin
some browsers for example do not load ICO images without mask apparently, the mask just makes the image bigger in (data) size tho - the actual image data is the same (32-bit depth BGRA) Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
aaea32c10c
commit
ea22f815a4
1 changed files with 6 additions and 1 deletions
|
@ -330,7 +330,7 @@ bool ICOHandler::write(const QImage &image)
|
||||||
|
|
||||||
uint bmpheadersize = 40;
|
uint bmpheadersize = 40;
|
||||||
uint bmpwidth = bmpimage.width();
|
uint bmpwidth = bmpimage.width();
|
||||||
uint bmpheight = bmpimage.height();
|
uint bmpheight = (bmpimage.height() * 2);
|
||||||
ushort bmpplanes = 0;
|
ushort bmpplanes = 0;
|
||||||
ushort bmpbpp = bmpimage.depth();
|
ushort bmpbpp = bmpimage.depth();
|
||||||
uint bmpcompression = BMPCompression::CompressionRGB;
|
uint bmpcompression = BMPCompression::CompressionRGB;
|
||||||
|
@ -366,6 +366,11 @@ bool ICOHandler::write(const QImage &image)
|
||||||
datastream.writeRawData(bmpimagebits, bmpimagesize);
|
datastream.writeRawData(bmpimagebits, bmpimagesize);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const QImage bmpimagemask = bmpimage.createAlphaMask();
|
||||||
|
const char* bmpimagemaskbits = reinterpret_cast<const char*>(bmpimagemask.constBits());
|
||||||
|
uint bmpimagemasksize = bmpimagemask.byteCount();
|
||||||
|
datastream.writeRawData(bmpimagemaskbits, bmpimagemasksize);
|
||||||
|
|
||||||
return (datastream.status() == QDataStream::Ok);
|
return (datastream.status() == QDataStream::Ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue