From 2064f1cb80f9051fcb928d09d9cd23f8947d15d1 Mon Sep 17 00:00:00 2001 From: jypem Date: Tue, 26 Jul 2016 14:39:12 +0300 Subject: [PATCH] Handle error when loading game icon (#1687) --- rpcs3/Gui/GameViewer.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rpcs3/Gui/GameViewer.cpp b/rpcs3/Gui/GameViewer.cpp index 495f403aa1..d4a5d01bdb 100644 --- a/rpcs3/Gui/GameViewer.cpp +++ b/rpcs3/Gui/GameViewer.cpp @@ -335,10 +335,16 @@ void ColumnsArr::Update(const std::vector& game_data) { wxLogNull logNo; // temporary disable wx warnings ("iCCP: known incorrect sRGB profile" spamming) if (game_icon.LoadFile(fmt::FromUTF8(path), wxBITMAP_TYPE_PNG)) + { game_icon.Rescale(80, 44, wxIMAGE_QUALITY_HIGH); + m_icon_indexes.push_back(m_img_list->Add(game_icon)); + } + else + { + LOG_ERROR(GENERAL, "Error loading image %s", path); + m_icon_indexes.push_back(-1); + } } - - m_icon_indexes.push_back(m_img_list->Add(game_icon)); } } @@ -376,7 +382,8 @@ void ColumnsArr::ShowData(wxListView* list) list->SetItemData(i, i); } list->SetItem(i, c, fmt::FromUTF8(col->data[i])); - list->SetItemColumnImage(i, 0, m_icon_indexes[i]); + if (m_icon_indexes[i] >= 0) + list->SetItemColumnImage(i, 0, m_icon_indexes[i]); } } }