summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-10-29 07:26:53 +0200
committergerman77 <juangerman-13@hotmail.com>2021-10-30 00:56:51 +0200
commitf503dbf07193c290bdd814024d58f5c69535d7d0 (patch)
tree07e1c5b1c73ad461c15163ac33a8bc42ff314e88
parentMerge pull request #7218 from bylaws/aswdqdsam (diff)
downloadyuzu-f503dbf07193c290bdd814024d58f5c69535d7d0.tar
yuzu-f503dbf07193c290bdd814024d58f5c69535d7d0.tar.gz
yuzu-f503dbf07193c290bdd814024d58f5c69535d7d0.tar.bz2
yuzu-f503dbf07193c290bdd814024d58f5c69535d7d0.tar.lz
yuzu-f503dbf07193c290bdd814024d58f5c69535d7d0.tar.xz
yuzu-f503dbf07193c290bdd814024d58f5c69535d7d0.tar.zst
yuzu-f503dbf07193c290bdd814024d58f5c69535d7d0.zip
-rw-r--r--src/yuzu/configuration/configure_profile_manager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp
index 99d5f4686..78b6374c0 100644
--- a/src/yuzu/configuration/configure_profile_manager.cpp
+++ b/src/yuzu/configuration/configure_profile_manager.cpp
@@ -306,6 +306,17 @@ void ConfigureProfileManager::SetUserImage() {
return;
}
+ // Some games crash when the profile image is too big. Resize any image bigger than 256x256
+ QImage image(image_path);
+ if (image.width() > 256 || image.height() > 256) {
+ image = image.scaled(256, 256, Qt::KeepAspectRatio);
+ if (!image.save(image_path)) {
+ QMessageBox::warning(this, tr("Error resizing user image"),
+ tr("Unable to resize image"));
+ return;
+ }
+ }
+
const auto username = GetAccountUsername(*profile_manager, *uuid);
item_model->setItem(index, 0,
new QStandardItem{GetIcon(*uuid), FormatUserEntryText(username, *uuid)});