summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-02-03 10:58:02 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2023-02-03 10:58:02 -0500
commita8d77b2e38fe5a26948064d980cdb43ace089e4c (patch)
tree43eeff7b4b67bf560b3ad98e981b2f33d3f76c61
parentca6f051c611a378e772994fd83e92bc50c87d46b (diff)
downloadlingo-a8d77b2e38fe5a26948064d980cdb43ace089e4c.tar.gz
lingo-a8d77b2e38fe5a26948064d980cdb43ace089e4c.tar.bz2
lingo-a8d77b2e38fe5a26948064d980cdb43ace089e4c.zip
Green bottom clues are converted to PNG now
fixes #25
-rw-r--r--lingo.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lingo.cpp b/lingo.cpp index 61a1f71..6ba60a9 100644 --- a/lingo.cpp +++ b/lingo.cpp
@@ -808,8 +808,15 @@ private:
808 throw std::runtime_error("Could not find image for green hint."); 808 throw std::runtime_error("Could not find image for green hint.");
809 } 809 }
810 810
811 genpuzzle.attachment_name = std::string("SPOILER_image.") + extension; 811 Magick::Blob inputblob(image.c_str(), image.length());
812 genpuzzle.attachment_content = std::move(image); 812 Magick::Image inputimg;
813 inputimg.read(inputblob);
814 inputimg.magick("png");
815 Magick::Blob outputblob;
816 inputimg.write(&outputblob);
817
818 genpuzzle.attachment_name = "SPOILER_image.png";
819 genpuzzle.attachment_content = std::string((const char*) outputblob.data(), outputblob.length());
813 } else { 820 } else {
814 double fontsize = 72; 821 double fontsize = 72;
815 std::string renderWord = solution.getText(); 822 std::string renderWord = solution.getText();