mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
Fix btt tft thumbnail regression (#3056)
fix btt tft thumbnail regression
This commit is contained in:
parent
933aa3050b
commit
b218d81d38
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,6 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb,
|
||||||
short i = 0;
|
short i = 0;
|
||||||
for (const ThumbnailData &data : thumbnails) {
|
for (const ThumbnailData &data : thumbnails) {
|
||||||
if (data.is_valid()) {
|
if (data.is_valid()) {
|
||||||
output("; THUMBNAIL_BLOCK_START\n");
|
|
||||||
auto compressed = compress_thumbnail(data, format);
|
auto compressed = compress_thumbnail(data, format);
|
||||||
if (compressed->data && compressed->size) {
|
if (compressed->data && compressed->size) {
|
||||||
if (format == GCodeThumbnailsFormat::BTT_TFT) {
|
if (format == GCodeThumbnailsFormat::BTT_TFT) {
|
||||||
|
@ -54,6 +53,7 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb,
|
||||||
if (i == (thumbnails.size() - 1))
|
if (i == (thumbnails.size() - 1))
|
||||||
output("; bigtree thumbnail end\r\n\r\n");
|
output("; bigtree thumbnail end\r\n\r\n");
|
||||||
} else {
|
} else {
|
||||||
|
output("; THUMBNAIL_BLOCK_START\n");
|
||||||
std::string encoded;
|
std::string encoded;
|
||||||
encoded.resize(boost::beast::detail::base64::encoded_size(compressed->size));
|
encoded.resize(boost::beast::detail::base64::encoded_size(compressed->size));
|
||||||
encoded.resize(boost::beast::detail::base64::encode((void *) encoded.data(), (const void *) compressed->data,
|
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\n") % encoded).str().c_str());
|
||||||
|
|
||||||
output((boost::format("; %s end\n") % compressed->tag()).str().c_str());
|
output((boost::format("; %s end\n") % compressed->tag()).str().c_str());
|
||||||
|
output("; THUMBNAIL_BLOCK_END\n\n");
|
||||||
}
|
}
|
||||||
throw_if_canceled();
|
throw_if_canceled();
|
||||||
}
|
}
|
||||||
output("; THUMBNAIL_BLOCK_END\n\n");
|
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue