store Avatar images as PNG format, to not lose the transparent of the pictures

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1609 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-09-07 13:59:38 +00:00
parent 5bcaa270ca
commit 758ba49ff1
4 changed files with 17 additions and 20 deletions

View file

@ -559,8 +559,8 @@ void MessengerWindow::updateAvatar()
// set the image
QPixmap pix ;
pix.loadFromData(data,size,"JPG") ;
ui.avatarButton->setIcon(pix); // writes image into ba in JPG format
pix.loadFromData(data,size,"PNG") ;
ui.avatarButton->setIcon(pix); // writes image into ba in PNG format
delete[] data ;
}
@ -578,7 +578,7 @@ void MessengerWindow::getAvatar()
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
picture.save(&buffer, "JPG"); // writes image into ba in JPG format
picture.save(&buffer, "PNG"); // writes image into ba in PNG format
std::cerr << "Image size = " << ba.size() << std::endl ;