gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-mdb] 65/93: qr gen


From: gnunet
Subject: [taler-taler-mdb] 65/93: qr gen
Date: Mon, 18 Nov 2019 21:13:28 +0100

This is an automated email from the git hooks/post-receive script.

marco-boss pushed a commit to branch master
in repository taler-mdb.

commit 2bb162be67130e4d1d1ff6253e4b3a2ab6288cbf
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Nov 16 10:34:30 2019 +0100

    qr gen
---
 src/main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main.c b/src/main.c
index dbdffa9..238ae71 100644
--- a/src/main.c
+++ b/src/main.c
@@ -243,6 +243,7 @@ show_qrcode (const char *uri)
   /* +8 for 4-pixels border */
   size = GNUNET_MIN (qrDisplay.var_info.xres,
                      qrDisplay.var_info.yres);
+  size /= 2;
   scale = size / (qrc->width + 8);
 #if LEGACY
   pixels = GNUNET_malloc (size * size * n_channels);
@@ -253,14 +254,13 @@ show_qrcode (const char *uri)
     yOff += (qrDisplay.var_info.yres - qrDisplay.var_info.xres) / 2;
   else
     xOff += (qrDisplay.var_info.xres - qrDisplay.var_info.yres) / 2;
-  for (unsigned int x = xOff; x < size + xOff; x++)
-    for (unsigned int y = yOff; y < size + yOff; y++)
+  for (unsigned int x = 0; x < size; x++)
+    for (unsigned int y = 0; y < size; y++)
     {
       unsigned int off =
-        ((x - xOff) * qrc->width / size) + ((y - yOff) * qrc->width / size)
-        * qrc->width;
-      qrDisplay.memory[y * qrDisplay.var_info.xres + x] =
-        (0 == (qrc->data[off] & 1)) ? 0xFFFF : 0x00;
+        (x * qrc->width / size) + (y * qrc->width / size) * qrc->width;
+      qrDisplay.memory[(y + yOff) * qrDisplay.var_info.xres + (x + xOff)] =
+        (0 == (qrc->data[off] & 1)) ? 0xFFFF : 0x0000;
     }
 
   QRcode_free (qrc);

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]