From 8579d456600c803bf194f5d9bc9f9dc863bb5dd1 Mon Sep 17 00:00:00 2001 From: "Alexey Ten (Lynn)" Date: Sat, 24 Jan 2015 21:42:47 +0300 Subject: [PATCH] Version 3.1.0 --- README.md | 7 ++----- package.json | 2 +- tests/test.js | 21 +-------------------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 9e7c95d..3a0fb4c 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ var svg_string = qr.imageSync('I love QR!', { type: 'svg' }); ### Methods * `qr.image(text, [ec_level | options])` — Readable stream with image data; - * `qr.imageSync(text, [ec_level | options])` — string with image data. (not implemented for `png`); + * `qr.imageSync(text, [ec_level | options])` — string with image data. (Buffer for `png`); * `qr.svgObject(text, [ec_level | options])` — object with SVG path and size; * `qr.matrix(text, [ec_level])` — 2D array. @@ -53,15 +53,12 @@ var svg_string = qr.imageSync('I love QR!', { type: 'svg' }); Changes ------- - * `size` option is also used for SVG. - * Add experimental `parse_url` option. First attemt to mix modes. - * Fix weird bug witch CRC32 calculation on Raspberry Pi. + * Implement `imageSync` for `png`. TODO ---- * Tests; - * `imageSync` for `png`. * mixing modes; * Kanji (???). diff --git a/package.json b/package.json index 6b589ca..c76d6a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qr-image", - "version": "3.0.2", + "version": "3.1.0", "description": "QR Code generator (png, svg, pdf, eps)", "homepage": "https://github.com/alexeyten/qr-image", "keywords": [ "qrcode", "qr code", "qr", "png", "svg", "image" ], diff --git a/tests/test.js b/tests/test.js index bb18e29..e56549d 100755 --- a/tests/test.js +++ b/tests/test.js @@ -16,23 +16,4 @@ qr.image(text, { type: 'svg', ec_level: ec_level}).pipe(file('qr.svg')); qr.image(text, { type: 'eps', ec_level: ec_level}).pipe(file('qr.eps')); qr.image(text, { type: 'pdf', ec_level: ec_level}).pipe(file('qr.pdf')); -/* -var raw = fs.readFileSync(__dirname + '/emblem.raw'); -raw.w = 45; -raw.h = 35; -qr.image(text, { - type: 'png', - ec_level: 'H', - size: 5, - margin: 4, - customize: function(data) { - var x = (data.size - raw.w) / 2; - var y = (data.size - raw.h) / 2; - - for (var i = 0; i < raw.h; i++) { - var offset = (y + i) * (data.size + 1) + x + 1; - raw.copy(data.data, offset, i * raw.w, (i + 1) * raw.w); - } - } -}).pipe(file('qr-emblem.png')); -*/ +fs.writeFileSync('qr_sync.png', qr.imageSync(text));