summaryrefslogtreecommitdiffstats
path: root/cqrlogo.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-06-27 13:43:33 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-06-27 13:43:33 +0200
commit5403395bcf563a1f5730ae5941493d6979be3155 (patch)
tree5fc8523444e2c2c165cb17f37630061eee1e0cd4 /cqrlogo.c
parent81e22becffcccf98e89a2c7ec5d33c4d12f8e9ed (diff)
downloadcqrlogo-5403395bcf563a1f5730ae5941493d6979be3155.tar.gz
cqrlogo-5403395bcf563a1f5730ae5941493d6979be3155.tar.zst
give scale via argument
Diffstat (limited to 'cqrlogo.c')
-rw-r--r--cqrlogo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/cqrlogo.c b/cqrlogo.c
index 5ed5a4c..dc76eac 100644
--- a/cqrlogo.c
+++ b/cqrlogo.c
@@ -23,7 +23,7 @@
* image size raises with higher levels */
#define QRCODE_LEVEL QR_ECLEVEL_L
-GdkPixbuf * encode_qrcode (char *text) {
+GdkPixbuf * encode_qrcode (char *text, int scale) {
QRcode *qrcode;
GdkPixbuf *pixbuf, *pixbuf_scaled;
int i, j, k, rowstride, channels;
@@ -52,8 +52,8 @@ GdkPixbuf * encode_qrcode (char *text) {
}
pixbuf_scaled = gdk_pixbuf_scale_simple (pixbuf,
- (qrcode->width + 2) * QRCODE_SCALE,
- (qrcode->width + 2) * QRCODE_SCALE,
+ (qrcode->width + 2) * scale,
+ (qrcode->width + 2) * scale,
GDK_INTERP_NEAREST);
QRcode_free(qrcode);
@@ -105,8 +105,8 @@ int main(int argc, char **argv) {
g_type_init();
#endif
- if ((pixbuf = encode_qrcode(http_referer)) == NULL) {
- if ((pixbuf = encode_qrcode(server_name)) == NULL) {
+ if ((pixbuf = encode_qrcode(http_referer, QRCODE_SCALE)) == NULL) {
+ if ((pixbuf = encode_qrcode(server_name, QRCODE_SCALE)) == NULL) {
fprintf(stderr, "Could not generate QR-Code.\n");
return EXIT_FAILURE;
}