jeromeetienne / jquery-qrcode

qrcode generation standalone (doesn't depend on external services)
http://blog.jetienne.com/blog/2011/04/07/jquery-qrcode/
MIT License
4.85k stars 2.5k forks source link

length of string seems to be an issue in general #5

Open michapixel opened 13 years ago

michapixel commented 13 years ago

e.g. "TODO make a nice looking pure client qrcode generator even allow download of the image" results in an error: "code length overflow. (700>288)". any hints and ideas on how to fix this would be great.

jsimoes commented 13 years ago

I agree with michapixel.. That would be great!

llama31 commented 13 years ago

I had just figured out that my problem wasn't the question mark, but the lenght of string! So I add my support to michapixel's query!

llama31 commented 13 years ago

Cr*p! The answer was lying here all that time! I hadn't seen there was a "closed issues" section.

https://github.com/jeromeetienne/jquery-qrcode/issues/2

So yeah. The problem is you have to specify a different typeNumber in your argument.

Do what senorprogrammer (what a nice nick) did and it should work; though myself, a value of 5 didn't work, 7 did the trick.

sweetsruthi commented 13 years ago

I need to use qrcode generator which supports atleast 256 characters. When i change typeNumber to 10 i am allowed only 122 characters. is there any help so that i can get for 256 characters??

if i use more than 10 for typeNumber i am get "undefined" from getRsBlockTable() function and giving me error " bad rs block @ typeNumber:20/errorCorrectLevel:2"

llama31 commented 13 years ago

Hi, Sorry buddy! I don't know about the inner logic of this thing. I was lucky enough to read the post talking about changer dhe typeNumber value, that's all... Sucks that a value higher than 10 results in an error! Good luck with whatever it is that you are coding.

Mat.

On Mon, May 30, 2011 at 4:48 AM, sweetsruthi < reply@reply.github.com>wrote:

I need to use qrcode generator which supports atleast 256 characters. When i change typeNumber to 10 i am allowed only 122 characters. is there any help so that i can get for 256 characters??

if i use more than 10 for typeNumber i am get "undefined" from getRsBlockTable() function and giving me error " bad rs block @ typeNumber:20/errorCorrectLevel:2"

Reply to this email directly or view it on GitHub: https://github.com/jeromeetienne/jquery-qrcode/issues/5#comment_1260558

JeroenvDijk commented 13 years ago

I checked the size ~ typeNumber... I built some function to check whether the script will work (in java)

private boolean typeHighEnough(int typeNumber, int length)
{
    int lengthCalculation = length * 8 + 12; // it seems...
    switch (typeNumber)
    {
    case 1:
        return lengthCalculation < 72;
    case 2:
        return lengthCalculation < 128;
    case 3:
        return lengthCalculation < 208;
    case 4:
        return lengthCalculation < 288;
    case 5:
        return lengthCalculation < 368;
    case 6:
        return lengthCalculation < 480;
    case 7:
        return lengthCalculation < 528;
    case 8:
        return lengthCalculation < 688;
    case 9:
        return lengthCalculation < 800;
    case 10:
        return lengthCalculation < 976;
    default:
    }
    return false;
}

I can't find any logic in there...

kernity commented 13 years ago

You can try my fork :

https://github.com/kernity/jquery-qrcode/commit/af5e6ef282e7ae3ade2ba239ea83a1bf17a8ccf4

JeroenvDijk commented 13 years ago

I must say... the part you changed looks NEAT! ....but what does it do??? What exactly does it calculate there and why is it so important?

In the end the result is the same as I did in java, but I am interested in what kind of calculation you do there... Could you help me?

Best regards, Jeroen

Op 27 sep. 2011, om 17:25 heeft kernity het volgende geschreven:

You can try my fork :

https://github.com/kernity/jquery-qrcode/commit/af5e6ef282e7ae3ade2ba239ea83a1bf17a8ccf4

Reply to this email directly or view it on GitHub: https://github.com/jeromeetienne/jquery-qrcode/issues/5#issuecomment-2212108

Met vriendelijke groet,

Jeroen van Dijk Topicus Zorg jeroen.van.dijk@topicus.nlmailto:jeroen.van.dijk@topicus.nl 06 - 233 60 293 http://www.topicuszorg.nl/ [cid:image002.gif@01CAEDC4.2CA51630]

kernity commented 13 years ago

I just used the failed check and try all versions till data fit in one.

I added the remaining Reed-Salomon Block Tables up to version 40, you can found them in many qrcode libs if you don't want to calculate them :-)