mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
profile_manager: Resize any image bigger than 256p
This commit is contained in:
parent
3c8c17be4d
commit
f503dbf071
|
@ -306,6 +306,17 @@ void ConfigureProfileManager::SetUserImage() {
|
||||||
return;
|
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);
|
const auto username = GetAccountUsername(*profile_manager, *uuid);
|
||||||
item_model->setItem(index, 0,
|
item_model->setItem(index, 0,
|
||||||
new QStandardItem{GetIcon(*uuid), FormatUserEntryText(username, *uuid)});
|
new QStandardItem{GetIcon(*uuid), FormatUserEntryText(username, *uuid)});
|
||||||
|
|
Loading…
Reference in a new issue