update
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#include "dialogs/EntityIntroPopup.h"
|
||||
|
||||
#include "core/image/ImageDecodeConfig.h"
|
||||
#include "core/image/ImageFileLoader.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QGuiApplication>
|
||||
@@ -95,7 +98,8 @@ void EntityIntroPopup::setContent(const core::EntityIntroContent& content) {
|
||||
auto* lab = new QLabel(m_imagesHost);
|
||||
lab->setAlignment(Qt::AlignCenter);
|
||||
if (!abs.isEmpty() && QFileInfo::exists(abs)) {
|
||||
QPixmap pm(abs);
|
||||
QPixmap pm = QPixmap::fromImage(
|
||||
core::image_file::loadImageLimited(abs, core::image_decode::kPreviewMaxPixels));
|
||||
if (!pm.isNull()) {
|
||||
if (pm.width() > kMaxThumb || pm.height() > kMaxThumb) {
|
||||
pm = pm.scaled(kMaxThumb, kMaxThumb, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
|
||||
Reference in New Issue
Block a user