whomwah/rqrcode

Support for version 11-40 codes

fabn opened this issue · 8 comments

fabn commented

According to QR standards they can store up to 2953 generic bytes (version 40, level L).

This library only supports versions 1-10. Is there any plan to support extended versions?

Why do you think the library only supports levels 1-10?

I just tried to make a level 20 qrcode that worked. But it does seam like levels above 20 are broken in some way =(.

I seams like it was my qrcode scanner that couldn't do above level 20. With http://www.onlinebarcodereader.com/ i have been able to scan qrcode up to level 32.

fabn commented

I was looking at this table and at the method smallest_size_for which automatically select size according to previous table.

# Should use level 21 with mode_8bit_byte
RQRCode::QRCode.new('a' * 383, level: :h)
#=> RQRCode::QRCodeRunTimeError: code length overflow. (383 digits > any version capacity)

# Should use level 11 with mode_alpha_numk
RQRCode::QRCode.new('A' * 225, level: :h, mode: :mode_alpha_numk) 
# => RQRCode::QRCodeRunTimeError: code length overflow. (225 digits > any version capacity)

By looking better at those tables it seems that the currently supported versions are

mode_number => version 1-10
mode_alpha_numk => version 1-10
mode_8bit_byte => version 1-20
mode_kanji => support dropped
fabn commented

i have been able to scan qrcode up to level 32.

How did you generate a lev 32 qr code?

I had forgotten about that. I think that's the only think blocking it from working with a higher level. If you create a pull request with the correct values from http://web.archive.org/web/20110710094556/http://www.denso-wave.com/qrcode/vertable4-e.html then i will merge and release.

RQRCode::QRCode.new( "S" * 2,840, :size => 32, :level => :l ).as_png(:file => "/tmp/out3.png")
fabn commented

Yes, I just saw that by myself 👍

I was using automatic size, for that reason I got those errors.

I'll try to submit a PR later.

I just love this.. People find problems and fix them =)