2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Replace image source after photo sending.

This commit is contained in:
John Preston
2018-10-23 12:33:01 +04:00
parent 4b5b79e415
commit 591fbf0ec6
4 changed files with 72 additions and 45 deletions

View File

@@ -880,15 +880,15 @@ PhotoData *Session::photoFromWeb(
if (full->isNull()) {
return nullptr;
}
const auto width = full->width();
const auto height = full->height();
if (thumb->isNull()) {
auto thumbsize = shrinkToKeepAspect(width, height, 100, 100);
thumb = ImagePtr(thumbsize.width(), thumbsize.height());
}
//const auto width = full->width();
//const auto height = full->height();
//if (thumb->isNull()) {
// auto thumbsize = shrinkToKeepAspect(width, height, 100, 100);
// thumb = ImagePtr(thumbsize.width(), thumbsize.height());
//}
auto mediumsize = shrinkToKeepAspect(width, height, 320, 320);
auto medium = ImagePtr(mediumsize.width(), mediumsize.height());
//auto mediumsize = shrinkToKeepAspect(width, height, 320, 320);
//auto medium = ImagePtr(mediumsize.width(), mediumsize.height());
return photo(
rand_value<PhotoId>(),
@@ -896,7 +896,7 @@ PhotoData *Session::photoFromWeb(
QByteArray(),
unixtime(),
thumb,
medium,
ImagePtr(),
full);
}