Skip to content

Commit

Permalink
Fix btt tft thumbnail regression (#3056)
Browse files Browse the repository at this point in the history
fix btt tft thumbnail regression
  • Loading branch information
SoftFever authored Dec 10, 2023
1 parent 933aa30 commit b218d81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libslic3r/GCode/Thumbnails.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand All @@ -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++;
}
Expand Down

0 comments on commit b218d81

Please sign in to comment.