From b218d81d38e166ab7a8182f1197fef3a36e9a05c Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sun, 10 Dec 2023 09:56:40 +0800 Subject: [PATCH] Fix btt tft thumbnail regression (#3056) fix btt tft thumbnail regression --- src/libslic3r/GCode/Thumbnails.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/Thumbnails.hpp b/src/libslic3r/GCode/Thumbnails.hpp index 772e63dd40..f4b76a3884 100644 --- a/src/libslic3r/GCode/Thumbnails.hpp +++ b/src/libslic3r/GCode/Thumbnails.hpp @@ -44,7 +44,6 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb, short i = 0; for (const ThumbnailData &data : thumbnails) { if (data.is_valid()) { - output("; THUMBNAIL_BLOCK_START\n"); auto compressed = compress_thumbnail(data, format); if (compressed->data && compressed->size) { if (format == GCodeThumbnailsFormat::BTT_TFT) { @@ -54,6 +53,7 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb, if (i == (thumbnails.size() - 1)) output("; bigtree thumbnail end\r\n\r\n"); } else { + output("; THUMBNAIL_BLOCK_START\n"); 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, @@ -71,10 +71,10 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb, output((boost::format("; %s\n") % encoded).str().c_str()); output((boost::format("; %s end\n") % compressed->tag()).str().c_str()); + output("; THUMBNAIL_BLOCK_END\n\n"); } throw_if_canceled(); } - output("; THUMBNAIL_BLOCK_END\n\n"); i++; }