From f61c504696748a5bd18a77b65e7582a5e4e2552b Mon Sep 17 00:00:00 2001 From: Exerqtor <41635644+Exerqtor@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:13:08 +0100 Subject: [PATCH] Fix for QOI thumbnails not working (#2755) Fix for QOI not working Should remidy the issues in https://github.com/SoftFever/OrcaSlicer/issues/2741 --- src/libslic3r/GCode/Thumbnails.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/GCode/Thumbnails.hpp b/src/libslic3r/GCode/Thumbnails.hpp index 380337e5bbe..744aacd10a1 100644 --- a/src/libslic3r/GCode/Thumbnails.hpp +++ b/src/libslic3r/GCode/Thumbnails.hpp @@ -57,15 +57,17 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb, std::string encoded; encoded.resize(boost::beast::detail::base64::encoded_size(compressed->size)); encoded.resize(boost::beast::detail::base64::encode((void *) encoded.data(), (const void *) compressed->data, - compressed->size)); - output((boost::format("; thumbnail begin %dx%d %d\n") % data.width % data.height % encoded.size()).str().c_str()); + compressed->size)); + output((boost::format("\n;\n; %s begin %dx%d %d\n") % compressed->tag() % data.width % data.height % encoded.size()) + .str() + .c_str()); while (encoded.size() > max_row_length) { output((boost::format("; %s\n") % encoded.substr(0, max_row_length)).str().c_str()); encoded = encoded.substr(max_row_length); } if (encoded.size() > 0) - output((boost::format("; %s\n") % encoded).str().c_str()); + output((boost::format("; %s end\n;\n") % compressed->tag()).str().c_str()); output("; thumbnail end\n"); } @@ -81,4 +83,4 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb, } // namespace Slic3r::GCodeThumbnails -#endif // slic3r_GCodeThumbnails_hpp_ \ No newline at end of file +#endif // slic3r_GCodeThumbnails_hpp_