mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 10:11:41 -05:00
Don't use WebDocument size field.
WebDocument size field is not a reliable information, it can be > 0 and != upload.WebFile size field, so just ignore it and load all WebDocument files as files with unknown size.
This commit is contained in:
parent
23b39923ad
commit
fde769e0b9
1 changed files with 4 additions and 1 deletions
|
@ -3474,7 +3474,10 @@ void HistoryInvoice::fillFromData(const MTPDmessageMediaInvoice &data) {
|
||||||
auto mediumsize = shrinkToKeepAspect(imageSize.width(), imageSize.height(), 320, 320);
|
auto mediumsize = shrinkToKeepAspect(imageSize.width(), imageSize.height(), 320, 320);
|
||||||
auto medium = ImagePtr(mediumsize.width(), mediumsize.height());
|
auto medium = ImagePtr(mediumsize.width(), mediumsize.height());
|
||||||
|
|
||||||
auto full = ImagePtr(WebFileImageLocation(imageSize.width(), imageSize.height(), doc.vdc_id.v, doc.vurl.v, doc.vaccess_hash.v), doc.vsize.v);
|
// We don't use size from WebDocument, because it is not reliable.
|
||||||
|
// It can be > 0 and different from the real size that we get in upload.WebFile result.
|
||||||
|
auto filesize = 0; // doc.vsize.v;
|
||||||
|
auto full = ImagePtr(WebFileImageLocation(imageSize.width(), imageSize.height(), doc.vdc_id.v, doc.vurl.v, doc.vaccess_hash.v), filesize);
|
||||||
auto photoId = rand_value<PhotoId>();
|
auto photoId = rand_value<PhotoId>();
|
||||||
auto photo = App::photoSet(photoId, 0, 0, unixtime(), thumb, medium, full);
|
auto photo = App::photoSet(photoId, 0, 0, unixtime(), thumb, medium, full);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue