mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-03 11:00:14 -05:00
switched all image outputs to jpeg format instead of png
This commit is contained in:
parent
f65a761c9d
commit
0a8f4b1b6e
@ -577,7 +577,7 @@ void IdEditDialog::createId()
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
mAvatar.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
mAvatar.save(&buffer, "JPG"); // writes image into ba in PNG format
|
||||
|
||||
params.mImage.copy((uint8_t *) ba.data(), ba.size());
|
||||
}
|
||||
@ -649,7 +649,7 @@ void IdEditDialog::updateId()
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
mAvatar.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
mAvatar.save(&buffer, "JPG"); // writes image into ba in PNG format
|
||||
|
||||
mEditGroup.mImage.copy((uint8_t *) ba.data(), ba.size());
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ void AlbumGroupDialog::prepareAlbumGroup(RsPhotoAlbum &group, const RsGroupMetaD
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
pixmap.save(&buffer, "JPG"); // writes image into ba in PNG format
|
||||
|
||||
group.mThumbnail.copy((uint8_t *) ba.data(), ba.size());
|
||||
} else {
|
||||
|
@ -47,7 +47,7 @@ void AlbumItem::setUp()
|
||||
if(mAlbum.mThumbnail.mSize != 0)
|
||||
{
|
||||
QPixmap qtn;
|
||||
qtn.loadFromData(mAlbum.mThumbnail.mData, mAlbum.mThumbnail.mSize, "PNG");
|
||||
qtn.loadFromData(mAlbum.mThumbnail.mData, mAlbum.mThumbnail.mSize, "JPG");
|
||||
ui->label_Thumbnail->setPixmap(qtn);
|
||||
}
|
||||
else
|
||||
|
@ -330,7 +330,7 @@ void BoardPostDisplayWidget_compact::setup()
|
||||
#ifdef DEBUG_BOARDPOSTDISPLAYWIDGET
|
||||
std::cerr << "Got pixmap of size " << pixmap.width() << " x " << pixmap.height() << std::endl;
|
||||
std::cerr << "Saving to pix.png" << std::endl;
|
||||
pixmap.save("pix.png","PNG");
|
||||
pixmap.save("pix.png","JPG");
|
||||
#endif
|
||||
|
||||
ui->pictureLabel->setPicture(pixmap);
|
||||
|
@ -105,7 +105,7 @@ void PostedGroupDialog::preparePostedGroup(RsPostedGroup &group, const RsGroupMe
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
pixmap.save(&buffer, "JPG"); // writes image into ba in PNG format
|
||||
|
||||
group.mGroupImage.copy((uint8_t *) ba.data(), ba.size());
|
||||
} else {
|
||||
|
@ -109,7 +109,7 @@ void WireGroupDialog::prepareWireGroup(RsWireGroup &group, const RsGroupMetaData
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
pixmap.save(&buffer, "JPG"); // writes image into ba in PNG format
|
||||
|
||||
group.mHeadshot.copy((uint8_t *) ba.data(), ba.size());
|
||||
} else {
|
||||
|
@ -1094,7 +1094,7 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const RsGxsId gx
|
||||
QImage image(icon.pixmap(height,height).toImage());
|
||||
QByteArray byteArray;
|
||||
QBuffer buffer(&byteArray);
|
||||
image.save(&buffer, "PNG"); // writes the image in PNG format inside the buffer
|
||||
image.save(&buffer, "JPG"); // writes the image in PNG format inside the buffer
|
||||
QString iconBase64 = QString::fromLatin1(byteArray.toBase64().data());
|
||||
strPreName = QString("<img src=\"data:image/png;base64,%1\" alt=\"[unsigned]\" />").arg(iconBase64);
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ void AvatarDialog::getAvatar(QByteArray &avatar)
|
||||
QBuffer buffer(&avatar);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
pixmap.save(&buffer, "JPG"); // writes image into ba in PNG format
|
||||
}
|
||||
|
||||
void AvatarDialog::load()
|
||||
|
@ -611,7 +611,7 @@ bool CreateGxsChannelMsg::setThumbNail(const std::string& path, int frame){
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
tNail.save(&buffer, "PNG");
|
||||
tNail.save(&buffer, "JPG");
|
||||
QPixmap img;
|
||||
img.loadFromData(ba, "PNG");
|
||||
img = img.scaled(thumbnail_label->width(), thumbnail_label->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
@ -814,7 +814,7 @@ void CreateGxsChannelMsg::sendMessage(const std::string &subject, const std::str
|
||||
// send chan image
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
preview_W->getCroppedScaledPicture().save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
preview_W->getCroppedScaledPicture().save(&buffer, "JPG"); // writes image into ba in PNG format
|
||||
post.mThumbnail.copy((uint8_t *) ba.data(), ba.size());
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ void GxsChannelGroupDialog::prepareChannelGroup(RsGxsChannelGroup &group, const
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
pixmap.save(&buffer, "JPG"); // writes image into ba in PNG format
|
||||
|
||||
group.mImage.copy((uint8_t *) ba.data(), ba.size());
|
||||
} else {
|
||||
|
@ -350,7 +350,7 @@ void ZoomableLabel::updateView()
|
||||
std::cerr << " Image size: " << mFullImage.width() << " x " << mFullImage.height() << ", window size: " << width() << " x " << height() << std::endl;
|
||||
std::cerr << " cropped image: " << rect.left() << "," << rect.top() << "+" << rect.width() << "+" << rect.height() << std::endl;
|
||||
std::cerr << " saving crop to pix2.png" << std::endl;
|
||||
mFullImage.copy(rect).save("pix2.png","PNG");
|
||||
mFullImage.copy(rect).save("pix2.png","JPG");
|
||||
#endif
|
||||
QLabel::setPixmap(mFullImage.copy(rect));
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem &
|
||||
// {
|
||||
// QFile file("yourFile.png");
|
||||
// file.open(QIODevice::WriteOnly);
|
||||
// pixmap.save(&file, "PNG");
|
||||
// pixmap.save(&file, "JPG");
|
||||
// file.close();
|
||||
// }
|
||||
|
||||
|
@ -166,7 +166,7 @@ int ImageUtil::checkSize(QByteArray &bytearray, const QImage &img)
|
||||
|
||||
//std::cout << QString("Trying image: format PNG, size %1x%2, colors %3\n").arg(img.width()).arg(img.height()).arg(img.colorCount()).toStdString();
|
||||
if (buffer.open(QIODevice::WriteOnly)) {
|
||||
if (img.save(&buffer, "PNG", 0)) {
|
||||
if (img.save(&buffer, "JPG", 0)) {
|
||||
size = bytearray.length();
|
||||
} else {
|
||||
std::cerr << "ImageUtil: image can't be saved to buffer" << std::endl;
|
||||
|
@ -291,7 +291,7 @@ bool misc::getOpenAvatarPicture(QWidget *parent, QByteArray &image_data)
|
||||
// save image in QByteArray
|
||||
QBuffer buffer(&image_data);
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
picture.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
picture.save(&buffer, "JPG"); // writes image into ba in JPG format
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user