mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #1100 from hunbernd/feature/image-embed3
Fixed resize bug
This commit is contained in:
commit
225058a9dc
@ -64,9 +64,10 @@ bool ImageUtil::optimizeSize(QString &html, const QImage& original, QImage &opti
|
|||||||
//Downscale the image to fit into maxPixels
|
//Downscale the image to fit into maxPixels
|
||||||
double whratio = (qreal)original.width() / (qreal)original.height();
|
double whratio = (qreal)original.width() / (qreal)original.height();
|
||||||
int maxwidth;
|
int maxwidth;
|
||||||
if(maxPixels > 0)
|
if(maxPixels > 0) {
|
||||||
maxwidth = (int)sqrt((double)(maxPixels) * whratio);
|
int maxwidth2 = (int)sqrt((double)(maxPixels) * whratio);
|
||||||
else
|
maxwidth = (original.width() > maxwidth2) ? maxwidth2 : original.width();
|
||||||
|
} else
|
||||||
maxwidth = original.width();
|
maxwidth = original.width();
|
||||||
|
|
||||||
int minwidth = (int)sqrt(100.0 * whratio);
|
int minwidth = (int)sqrt(100.0 * whratio);
|
||||||
|
Loading…
Reference in New Issue
Block a user