alexeyten / qr-image

Yet another QR code generator
MIT License
1.05k stars 168 forks source link

Generated content different in Microsoft Edge #26

Open RinkAttendant6 opened 8 years ago

RinkAttendant6 commented 8 years ago

The library seems to be generating different content in Microsoft Edge (for both SVG and PNG), causing the QR code to be corrupt. This seems to occur more often for longer content.

Code:

'use strict';

var qr = require('qr-image');

var uri = 'https://[::1]/apps/foo/index.html?qid=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';
var image = qr.imageSync(uri, {type: 'svg'});
console.log(image);

Output (in Microsoft Edge 13.10586):

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 43 43"><path d="M1 1h7v7h-7zM11 1h4v1h-1v1h-1v-1h-1v1h-1v1h-1v4h1v-3h1v-1h1v1h1v-1h1v2h2v1h-1v1h-1v-1h-1v1h-1v-2h-1v3h1v1h1v-1h2v1h-1v1h2v2h-1v-1h-3v-1h-1v2h4v1h-1v1h2v-2h2v1h1v-2h1v-1h-1v1h-1v-1h-1v-2h1v1h1v-2h1v-2h-1v2h-1v-2h-1v-2h1v1h1v-2h1v-1h-2v1h-1v-2h5v1h-1v1h4v1h1v2h3v-1h1v1h1v2h-1v-1h-1v2h-2v1h-1v1h3v-2h2v-1h1v-3h-1v-2h1v-2h1v10h1v2h-2v2h-1v-1h-1v1h1v1h-3v1h3v-1h1v-1h2v1h-1v1h-1v2h-1v-1h-1v1h1v1h-3v1h3v-1h1v-1h2v1h-1v1h-1v2h-1v-1h-1v1h1v1h1v-1h2v1h-1v1h-1v2h-1v-1h-1v1h1v1h1v-1h2v1h-1v1h-1v2h-1v-1h-1v1h1v1h1v1h1v-2h1v-1h1v-1h-1v-1h2v-1h-2v-1h1v-1h-1v-1h2v-1h-2v-1h1v-1h1v1h1v2h1v1h1v1h-1v1h-1v1h1v1h1v1h-1v1h-1v1h1v1h1v1h-1v1h-1v1h1v1h1v1h-1v1h-1v-1h-1v1h1v1h1v1h1v1h-6v-1h-1v-5h-1v2h-1v1h1v3h-3v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2h-1zM28 31h1v1h-1zM36 31v1h1v-1zM2 32h1v2h-1zM27 32h1v3h-1v-1h-1v-1h1zM40 32h1v1h-1zM5 33h1v1h-1zM7 33h2v1h-2zM23 33h1v1h-1zM9 34h2v2h1v2h-1v-1h-1v2h1v1h1v2h-1v-1h-1v-1h-1v-4h1v-1h-1zM12 34h1v1h-1zM24 34h1v1h-1zM31 34v1h2v-1zM34 34v3h3v-3zM40 34h2v1h-2zM1 35h7v7h-7zM13 35h1v1h-1zM16 35h1v1h1v1h-1v1h-1v1h1v1h1v1h-1v1h-4v-1h3v-1h-1v-2h-2v-1h3zM23 35h1v1h-1zM25 35h1v2h-1zM28 35h1v1h-1zM35 35h1v1h-1zM2 36v5h5v-5zM27 36h1v3h-1v-1h-1v-1h1zM40 36h1v1h-1zM3 37h3v3h-3zM18 37h1v1h-1zM23 37h1v1h-1zM12 38h1v1h-1zM17 38h1v1h-1zM24 38h1v1h-1zM35 38v1h1v-1zM40 38h2v1h-2zM13 39h1v1h-1zM25 39h1v2h-1zM28 39h1v1h-1zM36 40v1h1v-1zM40 40h1v1h-1zM9 41h1v1h-1zM18 41h1v1h-1zM26 41h2v1h-2z"/></svg>

Expected output (in IE 11, Chrome 49, and Firefox 45.0.2):

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 43 43"><path d="M1 1h7v7h-7zM10 1h1v2h1v-2h2v1h1v-1h1v2h1v1h-1v2h1v1h-1v1h-1v-2h-1v-1h1v-2h-2v1h-2v1h2v2h-1v3h-1v-1h-2v-6h1zM20 1h1v1h-1zM22 1h1v1h-1zM24 1h1v1h-1zM27 1h1v1h-1zM30 1h1v1h-1zM32 1h1v1h-1zM35 1h7v7h-7zM2 2v5h5v-5zM19 2h1v1h-1zM21 2h1v1h1v1h-1v1h-1zM26 2h1v1h-1zM28 2h1v1h-1zM31 2h1v1h-1zM36 2v5h5v-5zM3 3h3v3h-3zM24 3h1v1h-1zM37 3h3v3h-3zM13 4h1v1h-1zM17 4h1v1h1v1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1v-3h1zM19 24h4v1h-4zM30 24v1h1v-1zM37 24h1v1h-1zM40 24h2v1h-2zM9 25h1v1h-1zM23 25h1v1h-1zM38 25h2v1h-1v1h-4v-1h3zM8 26h1v1h-1zM24 26h1v1h-1zM41 26h1v1h-1zM25 27h1v2h-1zM40 27h1v2h-1zM4 28h1v1h-1zM10 28h2v1h-2zM35 28h4v1h1v2h1v1h-2v-1h-1v1h-1v-1h-1v2h2v2h1v2h-1v1h-1v1h2v1h-1v1h2v1h-4v-1h1v-1h-1v1h-1v-1h-1v-2h-1v-1h-1v-1h-1v-1h2v-2h1v-1h-1v-1h1v-1h2v-1h-1zM1 29h1v1h1v1h-1v3h-1zM3 29h1v1h-1zM37 29v1h1v-1zM4 30h1v1h1v1h1v1h1v1h-3v-2h-1zM22 30h4v1h-2v2h-2v1h-1v-3h1zM41 30h1v1h-1zM26 31h1v1h-1zM28 31h2v1h-1v1h-1zM31 31h1v1h-1zM3 32h1v2h-1zM19 32h1v2h-2v-1h1zM38 32h1v1h-1zM26 33h1v1h1v1h-2v1h-1v-1h-1v2h-3v-1h1v-2h4zM30 33h2v1h-1v1h-2v-1h1zM39 33h2v1h1v1h-2v-1h-1zM17 34h1v1h-1zM20 34h1v1h-1zM34 34v3h3v-3zM1 35h7v7h-7zM19 35h1v1h-1zM28 35h1v1h-1zM35 35h1v1h-1zM2 36v5h5v-5zM29 36h1v1h-1zM40 36h1v1h-1zM3 37h3v3h-3zM10 37v1h1v-1zM19 37h1v1h-1zM26 37h1v1h-1zM28 37h1v1h-1zM30 37h2v1h-1v1h2v1h1v1h-2v1h-3v-1h-1v-2h1v-1h1zM39 37h1v1h2v1h-3zM20 38h2v1h-2zM23 38h3v1h-2v1h2v1h-2v1h-1v-1h-1v-1h1zM27 38h1v1h-1zM35 38v1h1v-1zM14 40h1v1h2v1h-3zM17 40h1v1h-1zM30 40v1h1v-1zM40 40h1v1h-1zM9 41h1v1h-1zM18 41h3v1h-3zM26 41h2v1h-2zM34 41h1v1h-1z"/></svg>
alexeyten commented 8 years ago

This library was not intended for browser use as it heavily uses and relies on NodeJS Buffer.

But I'll look into this.

alexeyten commented 8 years ago

cannot reproduce