summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2021-10-31 04:07:34 -0700
committerGravatar GitHub2021-10-31 04:07:34 -0700
commit99ba26460d27601edf00a04ea5e8c018f7de5feb (patch)
tree5abe0534fb2ef0625fbac3b524aa5375af7877e3
parentMerge pull request #7201 from ameerj/spirv-depth-sampling (diff)
parentprofile_manager: Resize any image bigger than 256p (diff)
downloadyuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.tar.gz
yuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.tar.xz
yuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.zip
Merge pull request #7246 from german77/userimage
profile_manager: Resize any image bigger than 256p
Diffstat (limited to '')
-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() {
306 return; 306 return;
307 } 307 }
308 308
309 // Some games crash when the profile image is too big. Resize any image bigger than 256x256
310 QImage image(image_path);
311 if (image.width() > 256 || image.height() > 256) {
312 image = image.scaled(256, 256, Qt::KeepAspectRatio);
313 if (!image.save(image_path)) {
314 QMessageBox::warning(this, tr("Error resizing user image"),
315 tr("Unable to resize image"));
316 return;
317 }
318 }
319
309 const auto username = GetAccountUsername(*profile_manager, *uuid); 320 const auto username = GetAccountUsername(*profile_manager, *uuid);
310 item_model->setItem(index, 0, 321 item_model->setItem(index, 0,
311 new QStandardItem{GetIcon(*uuid), FormatUserEntryText(username, *uuid)}); 322 new QStandardItem{GetIcon(*uuid), FormatUserEntryText(username, *uuid)});