This commit is contained in:
wangjinlei
2024-07-17 09:23:45 +08:00
parent edf9deeb1a
commit 881ac3e056
1001 changed files with 41032 additions and 5452 deletions

View File

@@ -778,7 +778,7 @@ class Datamatrix {
if (isset($this->chset['SH1'][$chr])) {
$temp_cw[] = 0; // shift 1
$shiftset = $this->chset['SH1'];
} elseif (isset($chr, $this->chset['SH2'][$chr])) {
} elseif (isset($this->chset['SH2'][$chr])) {
$temp_cw[] = 1; // shift 2
$shiftset = $this->chset['SH2'];
} elseif (($enc == ENC_C40) AND isset($this->chset['S3C'][$chr])) {

View File

@@ -943,8 +943,8 @@ class PDF417 {
// tmp array for the 6 bytes block
$cw6 = array();
do {
$d = bcmod($t, '900');
$t = bcdiv($t, '900');
$d = bcmod($t, '900', 0);
$t = bcdiv($t, '900', 0);
// prepend the value to the beginning of the array
array_unshift($cw6, $d);
} while ($t != '0');
@@ -969,8 +969,8 @@ class PDF417 {
}
$t = '1'.$code;
do {
$d = bcmod($t, '900');
$t = bcdiv($t, '900');
$d = bcmod($t, '900', 0);
$t = bcdiv($t, '900', 0);
array_unshift($cw, $d);
} while ($t != '0');
$code = $rest;

View File

@@ -884,14 +884,15 @@ class QRcode {
protected function getCode() {
if ($this->count < $this->dataLength) {
$row = $this->count % $this->blocks;
$col = $this->count / $this->blocks;
$col = (int)($this->count / $this->blocks);
if ($col >= $this->rsblocks[0]['dataLength']) {
$row += $this->b1;
}
$row = (int) $row;
$ret = $this->rsblocks[$row]['data'][$col];
} elseif ($this->count < $this->dataLength + $this->eccLength) {
$row = ($this->count - $this->dataLength) % $this->blocks;
$col = ($this->count - $this->dataLength) / $this->blocks;
$col = (int)(($this->count - $this->dataLength) / $this->blocks);
$ret = $this->rsblocks[$row]['ecc'][$col];
} else {
return 0;
@@ -1062,7 +1063,7 @@ class QRcode {
protected function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly=false) {
$b = 0;
$bitMask = array();
$bitMask = $this->generateMaskNo($maskNo, $width, $s, $d);
$bitMask = $this->generateMaskNo($maskNo, $width, $s);
if ($maskGenOnly) {
return;
}
@@ -1460,7 +1461,7 @@ class QRcode {
$stringLen = strlen($this->dataStr);
$p = 0;
while ($p < $stringLen) {
$mode = $this->identifyMode(substr($this->dataStr, $p), $this->hint);
$mode = $this->identifyMode(substr($this->dataStr, $p));
if ($mode == QR_MODE_KJ) {
$p += 2;
} else {
@@ -1692,7 +1693,7 @@ class QRcode {
return -1;
}
$buf = array($size, $index, $parity);
$entry = $this->newInputItem(QR_MODE_ST, 3, buf);
$entry = $this->newInputItem(QR_MODE_ST, 3, $buf);
array_unshift($items, $entry);
return $items;
}