From a8d77b2e38fe5a26948064d980cdb43ace089e4c Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 3 Feb 2023 10:58:02 -0500 Subject: Green bottom clues are converted to PNG now fixes #25 --- lingo.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lingo.cpp') diff --git a/lingo.cpp b/lingo.cpp index 61a1f71..6ba60a9 100644 --- a/lingo.cpp +++ b/lingo.cpp @@ -808,8 +808,15 @@ private: throw std::runtime_error("Could not find image for green hint."); } - genpuzzle.attachment_name = std::string("SPOILER_image.") + extension; - genpuzzle.attachment_content = std::move(image); + Magick::Blob inputblob(image.c_str(), image.length()); + Magick::Image inputimg; + inputimg.read(inputblob); + inputimg.magick("png"); + Magick::Blob outputblob; + inputimg.write(&outputblob); + + genpuzzle.attachment_name = "SPOILER_image.png"; + genpuzzle.attachment_content = std::string((const char*) outputblob.data(), outputblob.length()); } else { double fontsize = 72; std::string renderWord = solution.getText(); -- cgit 1.4.1