jquery-qrcode icon indicating copy to clipboard operation
jquery-qrcode copied to clipboard

length of string seems to be an issue in general

Open michapixel opened this issue 13 years ago • 9 comments

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.

michapixel avatar May 06 '11 07:05 michapixel

I agree with michapixel.. That would be great!

jsimoes avatar May 06 '11 19:05 jsimoes

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 avatar May 10 '11 01:05 llama31

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.

llama31 avatar May 14 '11 23:05 llama31

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"

sweetsruthi avatar May 30 '11 08:05 sweetsruthi

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 < [email protected]>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

llama31 avatar May 30 '11 23:05 llama31

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...

JeroenvDijk avatar Sep 16 '11 21:09 JeroenvDijk

You can try my fork :

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

kernity avatar Sep 27 '11 15:09 kernity

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 [email protected]:[email protected] 06 - 233 60 293 http://www.topicuszorg.nl/ [cid:[email protected]]

JeroenvDijk avatar Sep 28 '11 14:09 JeroenvDijk

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 :-)

kernity avatar Sep 28 '11 18:09 kernity