Hello,
I am not sure if I should open a ticket on this or not, that is why I am emailing you. Is there a 26 character limit on the "Pattern for QR-Code Content:" field? I am trying to make a sticker sheet of URL's. The module works if I do a simple URL, for example, "http://www.google.com" is fine. However, when I try something bigger, for example, "http://sports.espn.go.com/nfl/bottomline/scores", the module will generate a blank page. I also get the following error,
"user error: QRcode : Overflow error in G:\xampplite\htdocs\drupal\sites\all\modules\qrs_sheets\materials\lib\qr_img\qr_img.php on line 354."
When I go on the "Reports -> Recent log entries" section, I get the following details,
Details
Type php
Date Tuesday, October 19, 2010 - 18:40
User admin
Location http://localhost/drupal/content/qr-sticker
Referrer http://localhost/drupal/admin/content/node
Message QRcode : Overflow error in G:\xampplite\htdocs\drupal\sites\all\modules\qrs_sheets\materials\lib\qr_img\qr_img.php on line 354.
Severity error
Hostname ::1
Operations
Another test I did was, I inputted the following text, "abcdefghijklmnopqrstuvwxyz". That generated the sheet with no problem. However, when I inputted the text, "abcdefghijklmnopqrstuvwxyz1", I got the aforementioned error.
I did some research and I thought the issue is a memory issue with the php.ini. I upped the memory to 256MB and the issue still persists.
Any help will be appreciated.
Thanks!
Comments
Comment #1
john.karahalis commentedThanks for reporting the issue, royb0y.
We just wanted to let you know that we are aware of your report and currently looking into it. We'll get back to you as soon as possible.
Comment #2
john.karahalis commentedQuick update.
We are seeing the same behavior. This seems to be related to a bug in the QR library we use, but we still have a bit more research to do before we can know how to fix it.
While we continue to look into this problem, there is one workaround you can use. It's not a permanent solution, but it should work for the time being.
Workaround
If you would like to use a URL with more than 26 characters as the "QR Pattern", first shorten the URL with a shortening service such as is.gd. This will provide you with a URL that is much shorter (in the case of is.gd, only 18 characters) that brings you to the same place.
Comment #3
john.karahalis commentedComment #4
royb0y commentedThanks for the feedback, and thanks for a temporary workaround. Good to know that we came to the same conclusion with the workaround =).
However, this temporary solution is not going to work for me in the long run. I know you guys are working on this issue, and I hope you come to a resolution as soon as possible.
Please, keep me updated.
Comment #5
royb0y commentedHello,
Just want to know if there's an update on this issue. Please let me know if you have an approximate timeline on when this issue is going to be resolved.
Thanks,
Comment #6
john.karahalis commentedHey royb0y.
I'm sorry we've been a bit sluggish on this issue. We're a student research and development lab currently working on many projects simultaneously. I know a lot of us wouldn't mind working on this and other meetü software full-time (I know I'd love to), but unfortunately we don't always have that capacity.
I'm going to forward your thoughts onto the faculty lead for this project. I really do care about your interest in this module, so hopefully we find a way to help you out with the limited capacity that we do have.
In the mean time (and I don't mean for this to sound like a cop-out), we do have the benefit that the project is open-source. If anyone in your group or a similar group has a solution, we would be very happy to accept a patch.
Comment #7
krem commentedHello,
Thanks for this great module !
I'm also getting blocked with this issue, I tried to check the source code but so far it seems that the problem comes from the QR library as you said...
Unfortunately I do not have the php skills to fix this, so I just hope that you will have at some point the time to look at it.
Best regards,
Clem
Comment #8
john.karahalis commentedThanks for confirming this bug, Clem. We'll try to squeeze some time into researching this in more detail soon.
Comment #9
john.karahalis commentedSo it looks like something weird is happening in the QR code library, and I'm starting to piece together what exactly it is. I'll post a more detailed response later today.
In the meantime...
Workaround 2
If your "Pattern for QR-Code Content" does not contain lower-case letters, your pattern can be up to 38 characters long. For example:
Does not work: http://opl.rit.edu/affiliates/
Works: HTTP://OPL.RIT.EDU/AFFILIATES/
I have determined what part of the code makes this distinction, but I do not know why it makes the distinction. As I said, a more detailed post will come shortly.
Comment #10
john.karahalis commentedIt seems that the library is correct to allow text strings without lowercase letters to be longer. As far as I can tell, the QR code specification defines alphanumeric strings to be those containing numbers, capital letters, and certain symbols. Strings with lowercase letters are considered to be binary data. The following documents seem to confirm this understanding. (Unfortunately, ISO/IEC 18004:2006 (the QR Code standard) is not freely available, making it difficult to claim this with absolute certainty.)
http://mdn.morovia.com/manuals/qrcode-fontware/ch02s01.php#N1012B
http://www.qrme.co.uk/qr-code-forum.html?func=view&catid=3&id=324
Now consider the following table, detailing QR code capacity.
http://www.denso-wave.com/qrcode/vertable1-e.html
In this module, we are using "Version" 2 and "ECC Level" M. The table clearly specifies that QR codes of this type can contain 38 characters in alphanumeric mode (no lowercase letters), but only 26 characters in binary mode. That explains it.
Of course, this does not explain the solution. More on that next.
Comment #11
john.karahalis commentedSo at the end of the day (literally, check the timestamps), it looks like the QR Code library is not fully to blame. It could have done more to fail gracefully ("Overflow error" didn't really tell us much), but the behavior itself was not wrong. We allowed the user to provide text strings longer than could possibly fit into a "Version 2" QR Code. The library realized this and refused to generate a QR Code.
Moving forward, I see two things that we need to do to fix this problem.
Our institute (RIT) is closed down until after the new year, but we will try to look into these fixes after that time. I again cannot make any promises on behalf of my Lab, as we are a bit overbooked with other projects as always. (I hope that the December 24, 2am timestamp of this post lends credibility to my argument that we are happy to work on this, but sometimes have trouble finding time to do so.)
In the meantime, I hope that the technical information provided here is enough to be useful to other Drupal developers. If anyone would be interested in signing on as a co-maintainer of this module, feel free to get in touch with us. We would of course love and welcome the help.
Comment #12
john.karahalis commentedroyb0y: Now that I have an understanding of the problem, I have a workaround that should actually work for you.
Workaround 3: Manually allow pattern to contain up to 62 characters
//$qrcode_version=@$_GET["v"];$qrcode_version=4;Keep in mind that we can't guarantee that this workaround will not cause other problems -- we haven't tested it extensively as we have the rest of the software. If you run into any problems with this workaround, please let us know and we will try to work with you to resolve those new issues.
(While we're on the topic, it's worth noting that the QR Code library claims that it will adjust QR Code Version automatically, but it obviously doesn't seem to be doing that. Perhaps it does have a of bug after all. Something to look into while we work a fix for this problem.)