mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-07 13:52:43 -04:00
added auto-choose of image format when transparency is present
This commit is contained in:
parent
de1b8f08d2
commit
7aacfb9aef
6 changed files with 47 additions and 23 deletions
|
@ -22,8 +22,9 @@
|
|||
#include "PostedGroupDialog.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "gui/common/FilesDefs.h"
|
||||
#include "util/imageutil.h"
|
||||
|
||||
#include <retroshare/rswiki.h>
|
||||
#include "retroshare/rswiki.h"
|
||||
#include <iostream>
|
||||
|
||||
const uint32_t PostedCreateEnabledFlags = (
|
||||
|
@ -104,8 +105,10 @@ void PostedGroupDialog::preparePostedGroup(RsPostedGroup &group, const RsGroupMe
|
|||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
bool has_transparency = ImageUtil::hasAlphaContent(pixmap.toImage());
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, has_transparency?"PNG":"JPG"); // writes image into ba in PNG format
|
||||
|
||||
group.mGroupImage.copy((uint8_t *) ba.data(), ba.size());
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue