/svc/barcode does not currently accept width and height parameters, even though GD::Barcode does. We should allow these to be passed in.
Is width an option? I don't see it: https://metacpan.org/pod/GD::Barcode
Created attachment 129198 [details] [review] Bug 20894: Add barcode size parameters to /svc/barcode This patch adds a couple of new parameters to the barcode generator service: "modulesize," which controls the size of QRcodes*, and "height," which can be applied to all other barcode types. * The "modulesize" number refers to the pixel dimensions of each black and white square in the generated QRcode. The dimensions in "squares" of the QR code depends on how much data is being encoded. For QRcodes, one default parameters is used: An error-correction level of "M" (Medium, https://en.wikipedia.org/wiki/QR_code#Error_correction). To test, apply the patch and restart services. Test various settings to confirm that barcodes are displayed correctly: http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=QRcode&modulesize=3&barcode=https%3A%2F%2Fkoha-community.org http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=QRcode&modulesize=6&barcode=https%3A%2F%2Fkoha-community.org http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Code39&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Code39&height=20&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=COOP2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=IATA2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Industrial2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=ITF&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Matrix2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=NW7&height=50&barcode=32000000203734
(In reply to Owen Leonard from comment #1) > Is width an option? I don't see it: https://metacpan.org/pod/GD::Barcode There is a width parameter in the source code, but I haven't tested if it can be used: https://metacpan.org/dist/GD-Barcode/source/Barcode.pm#L60
Created attachment 129838 [details] [review] Bug 20894: Add barcode size parameters to /svc/barcode This patch adds a couple of new parameters to the barcode generator service: "modulesize," which controls the size of QRcodes*, and "height," which can be applied to all other barcode types. * The "modulesize" number refers to the pixel dimensions of each black and white square in the generated QRcode. The dimensions in "squares" of the QR code depends on how much data is being encoded. For QRcodes, one default parameters is used: An error-correction level of "M" (Medium, https://en.wikipedia.org/wiki/QR_code#Error_correction). To test, apply the patch and restart services. Test various settings to confirm that barcodes are displayed correctly: http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=QRcode&modulesize=3&barcode=https%3A%2F%2Fkoha-community.org http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=QRcode&modulesize=6&barcode=https%3A%2F%2Fkoha-community.org http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Code39&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Code39&height=20&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=COOP2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=IATA2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Industrial2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=ITF&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Matrix2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=NW7&height=50&barcode=32000000203734 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 130040 [details] [review] Bug 20894: Add barcode size parameters to /svc/barcode This patch adds a couple of new parameters to the barcode generator service: "modulesize," which controls the size of QRcodes*, and "height," which can be applied to all other barcode types. * The "modulesize" number refers to the pixel dimensions of each black and white square in the generated QRcode. The dimensions in "squares" of the QR code depends on how much data is being encoded. For QRcodes, one default parameters is used: An error-correction level of "M" (Medium, https://en.wikipedia.org/wiki/QR_code#Error_correction). To test, apply the patch and restart services. Test various settings to confirm that barcodes are displayed correctly: http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=QRcode&modulesize=3&barcode=https%3A%2F%2Fkoha-community.org http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=QRcode&modulesize=6&barcode=https%3A%2F%2Fkoha-community.org http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Code39&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Code39&height=20&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=COOP2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=IATA2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Industrial2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=ITF&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=Matrix2of5&height=50&barcode=32000000203734 http://127.0.0.1:8081/cgi-bin/koha/svc/barcode?type=NW7&height=50&barcode=32000000203734 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
QA Comment: Just wondering: should I view a QR code as a barcode? Probably. Note also that the QR code comes from GD::Barcode::QRcode. Apparently GD passes it on or so ? Answering my first question: A QR code is a type of barcode that can be read easily by a digital device and which stores information as a series of pixels in a square-shaped grid. OK NP
Pushed to master for 22.05, thanks to everybody involved [U+1F984]