Check chat background read result.

This commit is contained in:
John Preston 2024-04-16 11:31:38 +04:00
parent 849ce310c4
commit abcf55c498
1 changed files with 6 additions and 1 deletions

View File

@ -909,12 +909,17 @@ QImage PrepareImageForTiled(const QImage &prepared) {
const QString &path,
const QByteArray &content,
bool gzipSvg) {
return Images::Read({
auto result = Images::Read({
.path = path,
.content = content,
.maxSize = QSize(kMaxSize, kMaxSize),
.gzipSvg = gzipSvg,
}).image;
if (result.isNull()) {
result = QImage(1, 1, QImage::Format_ARGB32_Premultiplied);
result.fill(Qt::black);
}
return result;
}
QImage GenerateBackgroundImage(