Coder Social home page Coder Social logo

Comments (4)

vivaxy avatar vivaxy commented on July 28, 2024

add

QRCodeModel.prototype = {
        // ...
        make: function () {
            if (this.typeNumber < 1) {
                var typeNumber = 1;
                for (typeNumber = 1; typeNumber < 40; typeNumber++) {
                    var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);

                    var buffer = new QRBitBuffer();
                    var totalDataCount = 0;
                    for (var i = 0; i < rsBlocks.length; i++) {
                        totalDataCount += rsBlocks[i].dataCount;
                    }

                    for (var i = 0; i < this.dataList.length; i++) {
                        var data = this.dataList[i];
                        buffer.put(data.mode, 4);
                        buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
                        data.write(buffer);
                    }
                    if (buffer.getLengthInBits() <= totalDataCount * 8)
                        break;
                }
                this.typeNumber = typeNumber;
            }
            this.makeImpl(false, this.getBestMaskPattern());
        }
        // ...

modify

    QRCode.prototype.makeCode = function (sText) {
        this._oQRCode = new QRCodeModel(-1, this._htOption.correctLevel);
        this._oQRCode.addData(sText);
        this._oQRCode.make();
        //this._el.title = sText;
        this._oDrawing.draw(this._oQRCode);
        this.makeImage();
    };

remove _getTypeNumber definition and usage.

from qrcodejs.

axtux avatar axtux commented on July 28, 2024

Same error. This seems to happen when URL contains some URLEncoded parts. Can you explain your fix ?

from qrcodejs.

vivaxy avatar vivaxy commented on July 28, 2024

@axtux
I didn't really looked into these codes, but it really works.
I found it here, which I was using years ago, and it always works.

from qrcodejs.

axtux avatar axtux commented on July 28, 2024

It just seems that qrcode.min.js is not up to date. Getting qrcode.js and minify it yourself is working.

from qrcodejs.

Related Issues (20)

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.