Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gubi committed Apr 23, 2019
1 parent 010bb1e commit ceecb50
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions barcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -3345,4 +3348,4 @@ private function dmtx_place_b(&$matrix, $rows, $cols, $row, $col, $b) {
119, 238, 241, 207, 179, 75, 150, 1,
);

}
}

0 comments on commit ceecb50

Please sign in to comment.