diff options
author | bunnei <bunneidev@gmail.com> | 2021-10-31 12:07:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-31 12:07:34 +0100 |
commit | 99ba26460d27601edf00a04ea5e8c018f7de5feb (patch) | |
tree | 5abe0534fb2ef0625fbac3b524aa5375af7877e3 | |
parent | Merge pull request #7201 from ameerj/spirv-depth-sampling (diff) | |
parent | profile_manager: Resize any image bigger than 256p (diff) | |
download | yuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.tar yuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.tar.gz yuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.tar.bz2 yuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.tar.lz yuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.tar.xz yuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.tar.zst yuzu-99ba26460d27601edf00a04ea5e8c018f7de5feb.zip |
Diffstat (limited to '')
-rw-r--r-- | src/yuzu/configuration/configure_profile_manager.cpp | 11 |
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)}); |