From 5187e6dc58fb7e28eb2583789d8705d82fc35c80 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 8 Apr 2019 23:50:18 +0300 Subject: [PATCH] Added display of image dimensions instead of 0 bytes when is doc. --- Telegram/SourceFiles/boxes/edit_caption_box.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index f3eb42f0c..cf7ed8333 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -388,10 +388,15 @@ void EditCaptionBox::updateEditPreview() { auto isGif = false; auto shouldAsDoc = true; + auto docPhotoSize = QSize(); if (const auto image = base::get_if(fileMedia)) { shouldAsDoc = !Storage::ValidateThumbDimensions( image->data.width(), image->data.height()); + if (shouldAsDoc) { + docPhotoSize.setWidth(image->data.width()); + docPhotoSize.setHeight(image->data.height()); + } isGif = image->animated; _animated = isGif; _photo = !isGif && !shouldAsDoc; @@ -429,6 +434,12 @@ void EditCaptionBox::updateEditPreview() { fileinfo.size() ? fileinfo.size() : _preparedList.files.front().content.size()); + // Show image dimensions if it should be sent as doc. + if (_isImage) { + _status = qsl("%1x%2") + .arg(docPhotoSize.width()) + .arg(docPhotoSize.height()); + } _doc = true; }