diff --git a/generic/imageplugin/imageplugin.cpp b/generic/imageplugin/imageplugin.cpp
index 2b1f7f02..737c98dd 100644
--- a/generic/imageplugin/imageplugin.cpp
+++ b/generic/imageplugin/imageplugin.cpp
@@ -267,11 +267,12 @@ void ImagePlugin::actionActivated()
}
QByteArray image;
+ QString mimeType("jpeg");
if(pix.height() > MAX_SIZE || pix.width() > MAX_SIZE) {
pix = pix.scaled(MAX_SIZE, MAX_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
QBuffer b(&image);
- pix.save(&b, "jpg");
+ pix.save(&b, mimeType.toAscii().constData());
QString imageBase64(QUrl::toPercentEncoding(image.toBase64()));
int length = image.length();
if(length > 61440) {
@@ -290,13 +291,13 @@ void ImagePlugin::actionActivated()
.arg(jidToSend)
.arg(stanzaSender->uniqueId(account))
.arg(body)
- .arg(fileName.right(fileName.length() - fileName.lastIndexOf(".") - 1))
+ .arg(mimeType)
.arg(imageBase64);
stanzaSender->sendStanza(account, msgHtml);
psiController->appendSysMsg(account, jidToSend, tr("Image %1 sent
")
.arg(imageName)
- .arg(fileName.right(fileName.length() - fileName.lastIndexOf(".") - 1))
+ .arg(mimeType)
.arg(imageBase64));