mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-03 03:54:04 -06:00
Fix for QOI thumbnails not working (#2755)
Fix for QOI not working Should remidy the issues in https://github.com/SoftFever/OrcaSlicer/issues/2741
This commit is contained in:
parent
bbdd580bb1
commit
f61c504696
1 changed files with 6 additions and 4 deletions
|
@ -57,15 +57,17 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb,
|
||||||
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,
|
||||||
compressed->size));
|
compressed->size));
|
||||||
output((boost::format("; thumbnail begin %dx%d %d\n") % data.width % data.height % encoded.size()).str().c_str());
|
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) {
|
while (encoded.size() > max_row_length) {
|
||||||
output((boost::format("; %s\n") % encoded.substr(0, max_row_length)).str().c_str());
|
output((boost::format("; %s\n") % encoded.substr(0, max_row_length)).str().c_str());
|
||||||
encoded = encoded.substr(max_row_length);
|
encoded = encoded.substr(max_row_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encoded.size() > 0)
|
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");
|
output("; thumbnail end\n");
|
||||||
}
|
}
|
||||||
|
@ -81,4 +83,4 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb,
|
||||||
|
|
||||||
} // namespace Slic3r::GCodeThumbnails
|
} // namespace Slic3r::GCodeThumbnails
|
||||||
|
|
||||||
#endif // slic3r_GCodeThumbnails_hpp_
|
#endif // slic3r_GCodeThumbnails_hpp_
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue