Commit d53a9063 authored by Igor Poboiko's avatar Igor Poboiko Committed by Laurent Montel
Browse files

Fix "Rescale QImage accordingly"

Rescale image only when needed (i.e. original image is larger than
desired). Also, when user don't want to rescale the image at all,
special values  width == -1 && height == -1 are provided; this case
should also be covered.
parent d651614a
Pipeline #21993 passed with stage
in 9 minutes and 30 seconds
......@@ -81,7 +81,9 @@ void RichTextComposerImages::addImageHelper(const QUrl &url, int width, int heig
= fi.baseName().isEmpty()
? QStringLiteral("image.png")
: QString(fi.baseName() + QLatin1String(".png"));
image = image.scaled(width, height);
if (width != -1 && height != -1 && (image.width() > width && image.height() > height)) {
image = image.scaled(width, height);
}
addImageHelper(imageName, image, width, height);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment