Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Looks like Google deprecated their generator in April:
http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html
It still works for now — but won't forever. Are there any plans to integrate an alternative?
Btw — so glad this module exists. Thanks!
Comment | File | Size | Author |
---|---|---|---|
#10 | barcode-offline_qr_generation-1717832-10.patch | 512.39 KB | Anonymous (not verified) |
#9 | barcode-offline_qr_generation-1717832-9.patch | 510.85 KB | Anonymous (not verified) |
#4 | barcode-offline_qr_generation-1717832-4.patch | 1.41 KB | stewart.adam |
Comments
Comment #1
skyredwangSo we have the time until April 2015? Can we safely postpone the search for replacement?
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedI've got the QR Code plug-in in Barcode working with the PHPQRCode library (https://github.com/t0k4rt/phpqrcode). This is my qrcode.inc (Barcode module QR Code plug-in):
You must install the libraries module & install the phpqrcode library in sites/all/libraries.
Notes: I have hardcoded the QR Code size & image format into the plug-in (& also changed the error correction quality to high). phpqrcode library only allows png, svg, & eps formats, I believe. And the size settings are a little more involved with this library than with Google's deprecated service: Google lets you set the image size you want (e.g., 200x200 pixels) & it does all the calculations for module size, etc. See http://www.qrcode.com/en/vertable1.html & http://phpmaster.com/generate-qr-codes-in-php/ for more information about QR Code sizing issues. So the way I have this written, it won't take values from the field's settings for size. I don't have time, unfortunately, to look at the code for those settings & figure out a good way of setting sizes, so I've simply hard-coded it for my needs.
If anyone wants to take this & incorporate it into Barcode, feel welcome to do so.
H.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedGoogle's going to be shutting down its QR Code generator, on which this module depends. I have got it working using the phpqrcode library instead.
You can use the code above to integrate with the library. One issue I had is that you couldn't define an absolute size in pixels for your bar code. I found a patch to the QR Code library that will allow you to do that. At:
http://sourceforge.net/tracker/?func=detail&aid=3543454&group_id=311533&...
Apply the patch to your phpqrcode library, then use the following code in the barcode module's qr code plugin:
Works perfectly for me. Hope the developers will be able to use this info.
Comment #4
stewart.adam CreditAttribution: stewart.adam commentedAttached patch based on #2 works for me. I removed the header call, as I want the QR code generation to work like other the plugins where it generates the image and the theme() call returns the image instead of displaying it directly in the browser.
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedso do I need to apply the patch in #4 and make the change in $3
Comment #6
stewart.adam CreditAttribution: stewart.adam commentedThey are equivalent, so you can use whichever of the two you are more comfortable with.
If you choose to avoid the patch and use #3, keep in mind my comments above though - it will always display the image immediately instead of returning an image file for display later.
Comment #7
cdeces CreditAttribution: cdeces as a volunteer commentedGoogle QR Code generators has stopped working. I've implemented solution #4 and tweaked the image size in the code.
But, this solution would need a better integration with the module, for instance to pass the image format, and image size from the field configuration to the phpqrcode library.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedThis is now critical as the current QRCode functionality is broken by the demise of Google's QRCoding service. Also a bug for the same reason.
The phpqrcode library will not natively let you set an absolute size in pixels for height & width. For different inputs you will get different sizes of QRCodes. In order to be able to set an absolute size for your barcodes using the phpqrcode library you must apply the patch at Sourceforge I linked to in #3 to your phpqrcode library (not to this module). Then what I did was hardcode my chosen dimensions into the QRCode plugin of the barcode module
The patch at #4 does not account for the lack of settings for fixed dimensions in the stock phpqrcode library, so keep that in mind if that's important to you.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedI am attaching a patch that makes the Barcode module use the phpqrcode library to generate QRCodes.
What it does:
1) Changes the settings form to permit selecting PNG or SVG format for QRCodes, & also the qrcode.inc plugin will now use the height setting here for its image dimensions.
2) Changes qrcode.inc to use the phpqrcode library. It will use the settings from the field settings page (see above). It includes definitions to permit the size in pixels setting to work with the phpqrcode library. Contrary to my previous code, it doesn't set a header, so it incorporates the changes suggested in #4.
3) It includes the phpqrcode library as a subfolder of the Barcode module. The version incorporated here has been patched with the patch I mentioned at #3, which permits the phpqrcode library to output images of a fixed pixel width & height. That is the only reason I am including it in this patch rather than suggesting installing it as a library with the Libraries module. It also accounts for the patch's size; apart from the phpqrcode inclusion it is quite small.
It applies cleanly against the most recent dev & works for me with both png & svg images, saving them to the public files directory as normal with the dimensions specified in settings.
Please review & commit soon, as this is completely broken currently.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedWhoops. The last patch I uploaded had some extraneous files. This one is clean & is the one to be reviewd.
Comment #11
BBCPatch #10 seems to be working nicely. I tried both png and svg modes. Only hiccup was that I had to adjust ownership on the phpqrcode/cache directory to the www-data user in order to avoid a series of PHP warnings.
Thanks much!
Comment #12
skyredwang@rhclayto Can you link to your phpqrcode library? We need to review the license and other things.
In general, we need to find an open source library to replace the existing library that we have been using (I don't think anyone has ever updated it since 2009 when I got it in first time). Ideally, we want to use one library that can generate QRCode as well as other types of barcode.
This one seems to be a good candidate https://github.com/dineshrabara/barcode , but I haven't tested it yet
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedHi,
Actually the whole patched library is part of the patch at #10, so you can see the whole thing in the patch. The license of the library is GPLv3.
Comment #14
skyredwang@rhclayto, I want to evaluate the library you included, like documentation, and community, etc.
On the other hand, we should use either Libraries API or Composer Manager to manage external library. (The reason that I didn't use it before, it is because it was in 2009.)
Comment #15
skyredwangdineshrabara/barcode project is based on Laravel. I don't think we want to bring in another framework just for generating barcodes.
But, as the author of TCPDF pointed out here, https://github.com/tecnickcom/tc-lib-barcode might be most complete.
Comment #16
edxxu CreditAttribution: edxxu at INsReady commentedCan we use http://phpqrcode.sourceforge.net/ to generate QR code?
Comment #17
stewart.adam CreditAttribution: stewart.adam commented@eduxxu that library hasn't seen updates in ages and if I remember correctly, setting image size dynamically is difficult and requires a patch + declaration of PHP constants.
Comment #18
HongPong CreditAttribution: HongPong at kor group commentedIt looks like tc-lib-barcode is still being actively developed and just had a tagged release 6 days ago so that is very promising I think.