added parameter to specify format to optimizeImageSize()

This commit is contained in:
csoler 2023-01-16 21:11:18 +01:00
parent 31bdd6c226
commit 516e4f7c12
10 changed files with 21 additions and 21 deletions

View file

@ -1677,7 +1677,7 @@ void ChatWidget::addExtraPicture()
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg *.jpeg *.gif *.webp )", file)) {
QString encodedImage;
uint32_t maxMessageSize = this->maxMessageSize();
if (RsHtml::makeEmbeddedImage(file, encodedImage, 640*480, maxMessageSize - 200)) { //-200 for the html stuff
if (RsHtml::makeEmbeddedImage(file, encodedImage, 640*480, maxMessageSize - 200)) { //-200 for the html stuff
QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);
ui->chatTextEdit->textCursor().insertFragment(fragment);
}