summaryrefslogtreecommitdiffhomepage
path: root/qrcode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qrcode.cpp')
-rw-r--r--qrcode.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/qrcode.cpp b/qrcode.cpp
index 5e45afc..da747a5 100644
--- a/qrcode.cpp
+++ b/qrcode.cpp
@@ -4,12 +4,17 @@
#include <qrcodegen/QrCode.hpp>
-#include <ImageMagick-6/Magick++.h>
+#include <Magick++.h>
using namespace qrcodegen;
using namespace Magick;
-std::string getQRCode(const std::string& data)
+void QRCode::init()
+{
+ Magick::InitializeMagick(NULL);
+}
+
+std::string QRCode::getQRCode(const std::string& data)
{
QrCode qrc {QrCode::encodeText(data.c_str(), QrCode::Ecc::MEDIUM)};
@@ -17,7 +22,6 @@ std::string getQRCode(const std::string& data)
Image image(fmt::format("{0}x{0}", size).c_str(), "white");
image.type(GrayscaleType);
- //image.size(fmt::format("{0}x{0}", size));
for (int x = 0; x < size; x++) {
for (int y = 0; y < size; y++) {