Giter Club home page Giter Club logo

qrcode's People

Contributors

komone avatar schemeway 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

qrcode's Issues

Invalid data embedded in the QR code

Hello,

I'm encoding the following string into the QR: http://localhost:4000/v1/sessions/9a454d3bb5d14369842f21a8f9683a87 which results in this image:
qrcode

The problem is that the actual data embedded in the QR is: http://localhost:4000/v1/sessions/9a454d3bb5d14369842f21a8f9683a8'. Notice the 7 at the end turned into '. I also saw similar errors which had 1 character wrong but not at the end of the string.

Here's my erl -v

erl -v
Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

One thing to note is that when using Q or L error correction modes it is working fine, at least for the given input string.

qrcode:encode crash for binary of size 14

qrcode:encode(<<"12345678901234">>).

is crashing, I am trying to fix it. Any help to fix it the "right" way would be helpful.
I guess other sizes may crash as well.

Runtime error when switching from 'M' error correction to 'H'

If I switch code encode(Bin, 'M'). to encode(Bin, 'H'). in qrcode.erl.

I get this:

** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in :qrcode_matrix.encode_bits0/2
        (qrcode) src/qrcode_matrix.erl:169: :qrcode_matrix.encode_bits0([:d, :d, :d, :d, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1], <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 0::size(1)>>)
        (qrcode) src/qrcode_matrix.erl:164: :qrcode_matrix.encode_bits/3
        (qrcode) src/qrcode_matrix.erl:53: :qrcode_matrix.finalize/5
        (qrcode) src/qrcode.erl:43: :qrcode.encode/2
        (qrcode) src/qrcode_png.erl:50: :qrcode_png.run/1
        (shoqr) web/controllers/v1/session_controller.ex:46: Shoqr.V1.SessionController.show_qr/2
        (shoqr) web/controllers/v1/session_controller.ex:11: Shoqr.V1.SessionController.phoenix_controller_pipeline/2
        (shoqr) lib/phoenix/router.ex:265: Shoqr.Router.dispatch/2
        (shoqr) web/router.ex:11: Shoqr.Router.do_call/2
        (shoqr) lib/shoqr/endpoint.ex:11: Shoqr.Endpoint.phoenix_pipeline/1
        (shoqr) lib/plug/debugger.ex:90: Shoqr.Endpoint."call (overridable 3)"/2
        (shoqr) lib/phoenix/endpoint/render_errors.ex:34: Shoqr.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

Note that switching to L or Q works fine.

Incorrect module name in qrcode.app: reedsolomon

Problem: Adding current commit to rebar.config and doing rebar compile gives:
...
ERROR: One or more modules listed in qrcode.app are not present in ebin/*.beam:
* reedsolomon

Solution: Changed "reedsolomon" to "qrcode_reedsolomon" in modules entry of ebin/qrcode.app.

qrcode:encode crash for special input

An other crash I am also trying to fix, may or may not be related to the size issue in issue 1.

qrcode:encode(<<"2014-01:09T23:21:46">>).

This call crash in an other way, the fix is not obvious for me. Any one?

exception qrcode:encode no function clause matching qrcode_matrix:encode_bits0

Some binary strings generate exception of qrcode:encode in qrcode_matrix:encode_bits0

exception error: no function clause matching 
                    qrcode_matrix:encode_bits0([d,d,1,0,0,0,0,1,1,1,1,0,1,0,0,
                                                1,0,1,0,0,0,0,0,0,1,0,1,0|...],
                                               <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                                 0,0,0,0,0,0,0,254,76,29,191,
                                                 128,65,...>>) 

first parameter is [d,d,1,1,0,1,1,0,0,0,0,1,0,1,1,0,1,0,0,0,1,1,1,0,0,1,0,1,1,1,1,1,1]
and H = d is not integer, it doesn't match neither encode_bits0([H|T], Acc) when is_integer(H) nor encode_bits0([], Acc)

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.