Code Monkey home page Code Monkey logo

qrcode-generator's Introduction

qrcode-generator's People

Contributors

aaroncampbell avatar ahwayakchih avatar codemasher avatar dogwong avatar doktorj avatar elhigu avatar kazuhikoarase avatar kohler avatar lexidor avatar mevdschee avatar mix3d avatar otacke avatar rdwebdesign avatar robthree avatar tomashubelbauer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qrcode-generator's Issues

Can't rendering at IE8

<title>mljia qrcode index</title> <script src="http://hidden.com/gen/js/jquery.js"></script> <script src="http://hidden.com/gen/js/jquery.qrcode.js"></script> <script src="http://hidden.com/gen/js/ff-range.js"></script>
<script language="javascript" > $(document).ready(function(){ 'use strict'; var $ = jQuery; var options = { render: "image", minVersion: 6, radius: 0.5, quiet: 1, mode: 4, mSize: 0.15, mPosX: 0.5, mPosY: 0.5, //fill: "#800080", fill: "#000000", background: "#ffffff", ecLevel: "M", size: 300, text: 'http://o2o.mljia.cn/100130', image: $("#img-buffer")[0] //label: '', //fontname: '', //fontcolor: '', //image: $("#img-buffer")[0] }; $("#container").empty().qrcode(options); }); </script>

PHP errors

Alpha Numeric with more than 271 characters fails.

add quiet zone on javascript version

hello,

is there a way to add a quiet zone on the generated qr-code?

i'm using the javascript version and when i donwload the image some scanners can't read due some black backgrounds. on my page it works perfectly, but once i download it the issue emerges.

import failed in TypeScript, and require is ok.

Hi, In TypeScript file, i use import('qrcode-generator') but there is an error of 'can't find the moudle' while i change 'import' into 'require' and it works. But since we start to use TypeScript2.0, we will not use require.
I think it may because there doesn't refer to the .d.ts file in the package.json.
Please resolve it.
Thank you!

Best mask choose wrong

Text:
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

Result:
企业微信截图_20190425103954

Length limit?

I have been playing with the code - cheers!

But while various specs say a QRCode can contain thousands of characters (and other apps encode long messages that are successfully decoded). This code seems limited to a couple of hundred chars...

How to generate new QR code with user input data?

Hi,
I am using this qr-code generator for my angular application. I am bit confused if this library provides a way to update the generated qr code based on the user given URL from the text box. I did that with updating of model property but nothing works. Any idea? please help.

Feature: create just data URL (in addition of complete `img` tag)

Currently, the main API is createImgTag() generating a complete img element, containing the image data in the src attribute as base64 encoded string. Setting other attributes (like id, class or style) or applying an style to that element is a bit cumbersome (not impossible, but additional work), because the HTML element isn't there before the call.

Other QR code libraries often have an additional method which generates just the data string (which createImgTag() creates as well, by the way), which then can be set / applied to an existing img element with other attributes remaining present.

So, suggestion is to refactor some of the logic of createImgTag() into createDataURL() which latter method can also be called separately. Idea:

qr.createImgTag()
// => <img src="data:image/gif;base64,R0lGODdhcgFyAY..." width="370" height="370">

qr.createDataURL()
// => data:image/gif;base64,R0lGODdhcgFyAY...

Generated QRCode has errors

Current code does not generate error free QR codes. Fortunately the errors are fixed by ReedSolomon, resulting in a still working QR code. The error is traced back to the following line, in the 'mapdata' function:

if  (col  ==  6)  col--;

This code is needed to skip the timing pattern column (col 6). But all columns <= 6 need to shift when filling the map data. Replacing the line with the following results in error free QR codes:

if (col <= 6) col--;

Thanks.

[Request] Repo restructuring pls

It seems you have many programming languages supported, that is great !
BUT, it makes it difficult for people to help/clone a specific language version, because they can only clone the whole with ALL of them.
So i suggest kindly to split your repo into branches per language.
For example a seperate repo-branch for js, another for php etc etc instead of one main branch... 👍

Increase type numbers for JS QR Generator

Hi,

I'm really happy with this library so far, thanks :)

I was wondering, would it be difficult to increase the type number up to 40?
I'm not entirely sure what needs to be done, perhaps if you can point me in the correct direction I can attempt to push up the limit. As I understand it 40 is the maximum type for QR codes, I'm personally in need of type 25+

Let me know if I am asking too much, I can always try to do this myself.

Regards,
Joe.

output as svg

is it possible to output the qr code as an svg file?

What is moduleCount?

I see that to create the image size moduleCount is used - what is that exactly?

Yes, some docs would be nice... or at least some code comments.
Why no docs / comments?

[Typescript] Cannot call a namespace

According to the typings from qrcode.d.ts, I should be able to do the following since the export is an instance of the QRCodeFactory interface which has the call signature (typeNumber: TypeNumber, errorCorrectionLevel: ErrorCorrectionLevel) : QRCode;:

import * as qrGenerator from 'qrcode-generator';

function myFunc() {
  const qr = qrGenerator(0, 'H');
  qr.addData('Hello, world!');
  qr.make();
}

However, the typescript compiler returns:

Error: Cannot call a namespace ('qrGenerator')

Alternatively, using qrcode like this compiles without a hitch:

import * as qrGenerator from 'qrcode-generator';

function myFunc() {
  const qr = qrcode(0, 'H');
  qr.addData('Hello, world!');
  qr.make();
}

But it throws a runtime error:

Uncaught ReferenceError: qrcode is not defined

can i generate qr code for personal picture or this not possible

Problem

can i generate qr code for personal picture or this not possible ?

What i Try

I already can generate qr code using message toolkit library by using c#

windows applications form to text only like address or phone or URL

I search for internet i found it can save image in public server and read by

using internet and this is best .

But I need to generate qr code for personal image meaning store image in qr code

Are this possible or not ?

Which library can used and free ?

Consider exporting the library as native ES module

Hello, I'd like to request that you add support for importing this library using native ES modules, like so:

import qrcode from 'https://unpkg.com/qrcode-generator/qrcode.js';

I would benefit from this when experimenting with QR codes locally, without a build process.

I would have created a pull request, but I am not sure how to feature detect and export the library. Theoretically all you need to do is to add export default { ... }, but in browsers where ES native modules are not supported yet, this would have caused an error to be thrown. At the same time, export cannot be stated conditionally, so feature detection for native ES modules and then export doesn't seem to be possible.

I know you are not using a build process, so I am not going to suggest you create two variants, one with ES module support and one without, because this is not a pressing issue at all (can always just use script and find what I need on window.qrcode), but I am interested if you have any thoughts on how this could be achieved without introducing a build process.

Alphanumeric mode does not work

Hi. When I try the alphanumeric mode, with any text (e.g. "here comes qr", it throws an error "Uncaught illegal char :h" in the console and no qr code is displayed. Is it a known issue and is going to be fixed?

PHP coding issues

Some issues with the code:

  1. To avoid a pass-by-reference warning in php 7, in the function addData the case-statement should be something like this (the "new" as a separate call):
        case QR_MODE_NUMBER :
	    $d = new QRNumber($data);
            $this->addDataImpl($d);
            break;

        case QR_MODE_ALPHA_NUM :
	    $d = new QRAlphaNum($data);
            $this->addDataImpl($d);
            break;

        case QR_MODE_8BIT_BYTE :
	    $d = new QR8BitByte($data);
            $this->addDataImpl($d);
            break;

        case QR_MODE_KANJI :
	    $d = new QRKanji($data);
            $this->addDataImpl($d);
            break;
  1. When coding a string like https://my.url.site/events/?eme_check_attendance=1&eme_pmt_rndid=5c4ac78bdaef8_8a5fe7041234573e19e7f9db6ba4fe38
    I got an error:
    PHP Fatal error: code length overflow. (988]72) in qrcode.php on line 362
    (I find the 988 very weird, and the 72 very small). I use this as a call:
    $qr = QRCode::getMinimumQRCode($my_example_url,QR_ERROR_CORRECT_LEVEL_H);
    Is this a bug?

Can you help me get this to work on the p5.js online editor?

This isn't an issue. I apologize for posting here. I'm wondering if you can help show me how to get this QR Code generator to work on the p5.js online editor? It's part of a project I'm working on where I want to generate colorful QR Codes. If you can help I'd greatly appreciate it!

White border around QR code

I'm trying to remove the white border/padding around the QR code. Is there any option to generate a QR code without a white frame around?
Thanks

New release

It's been a while since this project has made a release. I'm working on packaging it for Fedora, and it would be nice to have a recent release. Thanks!

Is there a way to manually set the mode to alphanumeric?

Can I manually force the generator to encode data using Alphanumeric mode, instead of Binary mode?

I'm finding out that for a Version=2, DataCorrection=H, I can only fit 14 characters into the QR code. This is inline with the character limits for a "Binary" QR Code. However, I want to encode with Alphanumeric.

It looks like the generator only accepts Version and DataCorrection inputs, and does not allow you to specify mode (Binary, Alphanumeric, Kanji, Numeric). Am I missing something?

Namespace collision

Hi,

I have a namespace collision between your library and this one (QR code reading library).

Both define the qrcode object.

What is your recommendation for fixing this ?

Uncaught code length overflow

I have some questions. I want to ask.Thanks.

when i code like this:
var typeNumber = 4; var errorCorrectionLevel = 'L'; var qr = qrcode(typeNumber, errorCorrectionLevel); qr.addData('here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!'); qr.make(); document.getElementById('placeHolder').innerHTML = qr.createImgTag();

the Error occurred like this:
qrcode.js:352 Uncaught code length overflow. (1244>512)

For some reason, I can't use especially “createElement” .from "sample.js":
`var body_loadHander = function() {
var crtOpt = function(value, label) {
var opt = document.createElement('option');
opt.appendChild(document.createTextNode(label) );
opt.value = value;
return opt;
};

var t = document.forms['qrForm'].elements['t'];
t.appendChild(crtOpt('' + 0, 'Auto Detect') );
for (var i = 1; i <= 40; i += 1) {
t.appendChild(crtOpt('' + i, '' + i) );
}
t.value = '0';
update_qrcode();
};`

I'm curious about what it's going to do。And especially when I delete that method.

Type number auto detection

I remember that this library used to support type number setting equal to -1 for automatically finding the optimal (1~40) version number and avoiding the problem when there's more text supplied for the QR Code than that type could hold.
Is there a way to implement the same kind of logic outside of the library, including the support for UTF-8?

Importing the Kanji support file in Node.js

Hello, I am confused as on how to import the Kanji qrcode_SJIS file in Node.js. When I tried:

const qrcode = require("qrcode-generator")
require("qrcode-generator/qrcode_SJIS")
const qr = qrcode(0, "L");
qr.addData(`敦煌天空的沙礫帶著我們的記憶`, `Kanji`);
qr.make();
console.log(qr.createSvgTag());

it died on an reference error in the qrcode_SJIS saying that qrcode is not defined 😕
Can you please provide an example on how to do this?

Typings ?

Will you be adding typings definition for this library ?
Wish I could use it in an angular2 and Ionic 2 project

README

Please make readme.md file for this code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.