From fefd13a4ac6397a9c7dad1c8f9a5381f05f1d953 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Fri, 7 Jul 2023 18:31:03 +0800 Subject: [PATCH] FIX: big thumbnail send by multi-frame Change-Id: Ia3a88fb53b8cc27d20fa976822c91c09b4442d71 --- src/slic3r/GUI/Printer/PrinterFileSystem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp index c47fec5cc1..912eb99941 100644 --- a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp +++ b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp @@ -842,7 +842,7 @@ void PrinterFileSystem::UpdateFocusThumbnail2(std::shared_ptr> file.path = path; return FILE_SIZE_ERR; } - auto n = file.path.find_last_of('#'); + auto n = path.find_last_of('#'); auto path2 = n == std::string::npos ? path : path.substr(0, n); auto iter = std::find_if(files->begin(), files->end(), [&path2](auto &f) { return f.path == path2; }); if (cont) { @@ -868,6 +868,9 @@ void PrinterFileSystem::UpdateFocusThumbnail2(std::shared_ptr> wxMemoryInputStream mis(data, size); mimetype.Replace("jpg", "jpeg"); file.thumbnail = wxImage(mis, mimetype); + if (!file.thumbnail.IsOk()) { + BOOST_LOG_TRIVIAL(info) << "PrinterFileSystem: parse thumbnail failed" << size << mimetype; + } } file.name = thumbnail; file.path = path;