From 886eabc6848568c8229db17f740688c240de37e2 Mon Sep 17 00:00:00 2001 From: Barton Chittenden Date: Fri, 27 Apr 2018 22:09:29 +0000 Subject: [PATCH] Bug 20676: svc/barcode should allow barcode to be printed without text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test plan: 1) Point web browser to /cgi-bin/koha/svc/barcode?barcode=*12345*¬ext=1 This will display a png image of the barcode *12345* with the text *12345* printed below the scannable barcode. 2) Apply patch 3) Refresh the browser. The human readable text no longer appears. Signed-off-by: Frédéric Demians Signed-off-by: Jonathan Druart --- svc/barcode | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/svc/barcode b/svc/barcode index 80b1504c22..d759c07bc1 100755 --- a/svc/barcode +++ b/svc/barcode @@ -58,6 +58,13 @@ COOP2of5 If ommited,it defaults to Code39. +=item I + +Unless I is specified in the parameter list, the +value of the barcode will included as text below the +scannable barcode. + + =back =head2 EXAMPLES @@ -72,6 +79,11 @@ Returns a Code39 barcode image for barcode 123456789 Returns a UPCE barcode image for barcode 123456789 +=item /cgi-bin/koha/svc/barcode?barcode=123456789¬ext=1 + +Returns a Code39 barcode image for barcode 123456789 +which does not include the human readable text '123456789' +below the scannable barcode. =cut my $input = new CGI; @@ -86,10 +98,11 @@ binmode(STDOUT); my $type = $input->param('type') || 'Code39'; my $barcode = $input->param('barcode'); +my $notext = $input->param('notext') ? 1 : 0; my $image; eval { - $image = GD::Barcode->new( $type, $barcode )->plot()->png(); + $image = GD::Barcode->new( $type, $barcode )->plot( NoText => $notext )->png(); }; if ( $@ ) { -- 2.11.0