mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Add some more information for an assertion violation.
This commit is contained in:
parent
12252ef1aa
commit
da1945d0ca
1 changed files with 14 additions and 2 deletions
|
@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/image/image_prepare.h"
|
||||
#include "ui/chat/attach/attach_extensions.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
#include "core/crash_reports.h"
|
||||
|
||||
#include <QtCore/QSemaphore>
|
||||
#include <QtCore/QMimeData>
|
||||
|
@ -328,10 +329,21 @@ void UpdateImageDetails(PreparedFile &file, int previewWidth) {
|
|||
: image->data;
|
||||
Assert(!preview.isNull());
|
||||
file.shownDimensions = PrepareShownDimensions(preview);
|
||||
const auto toWidth = std::min(
|
||||
previewWidth,
|
||||
style::ConvertScale(preview.width())
|
||||
) * cIntRetinaFactor();
|
||||
const auto scaled = preview.scaledToWidth(
|
||||
(std::min(previewWidth, style::ConvertScale(preview.width()))
|
||||
* cIntRetinaFactor()),
|
||||
toWidth,
|
||||
Qt::SmoothTransformation);
|
||||
if (scaled.isNull()) {
|
||||
CrashReports::SetAnnotation("Info", QString("%1x%2:%3*%4->%5;%6x%7"
|
||||
).arg(preview.width()).arg(preview.height()
|
||||
).arg(previewWidth).arg(cIntRetinaFactor()
|
||||
).arg(toWidth
|
||||
).arg(scaled.width()).arg(scaled.height()));
|
||||
Unexpected("Scaled is null.");
|
||||
}
|
||||
Assert(!scaled.isNull());
|
||||
file.preview = Images::prepareOpaque(scaled);
|
||||
Assert(!file.preview.isNull());
|
||||
|
|
Loading…
Add table
Reference in a new issue