diff --git a/barcode.php b/barcode.php index b111501..5aa25b7 100644 --- a/barcode.php +++ b/barcode.php @@ -322,6 +322,7 @@ private function linear_calculate_size($code, $widths) { private function linear_render_image( $image, $code, $x, $y, $w, $h, $colors, $widths, $options ) { + $showtext = (isset($options['st']) ? false : true); $textheight = (isset($options['th']) ? (int)$options['th'] : 10); $textsize = (isset($options['ts']) ? (int)$options['ts'] : 1); $textcolor = (isset($options['tc']) ? $options['tc'] : '000'); @@ -363,7 +364,9 @@ private function linear_render_image( $lx = ($x + ($mx - $x) * $lx); $lw = imagefontwidth($textsize) * strlen($label); $lx = round($lx - $lw / 2); - imagestring($image, $textsize, $lx, $ly, $label, $textcolor); + if($showtext) { + imagestring($image, $textsize, $lx, $ly, $label, $textcolor); + } } $x = $mx; } @@ -3345,4 +3348,4 @@ private function dmtx_place_b(&$matrix, $rows, $cols, $row, $col, $b) { 119, 238, 241, 207, 179, 75, 150, 1, ); -} \ No newline at end of file +}