Update TCPDF.
This commit is contained in:
@@ -636,7 +636,7 @@ class PDF417 {
|
||||
// add macro section
|
||||
$codewords = array_merge($codewords, $macrocw);
|
||||
}
|
||||
// Symbol Lenght Descriptor (number of data codewords including Symbol Lenght Descriptor and pad codewords)
|
||||
// Symbol Length Descriptor (number of data codewords including Symbol Length Descriptor and pad codewords)
|
||||
$sld = $size - $errsize;
|
||||
// add symbol length description
|
||||
array_unshift($codewords, $sld);
|
||||
@@ -740,16 +740,6 @@ class PDF417 {
|
||||
* @protected
|
||||
*/
|
||||
protected function getErrorCorrectionLevel($ecl, $numcw) {
|
||||
// get maximum correction level
|
||||
$maxecl = 8; // starting error level
|
||||
$maxerrsize = (928 - $numcw); // available codewords for error
|
||||
while ($maxecl > 0) {
|
||||
$errsize = (2 << $ecl);
|
||||
if ($maxerrsize >= $errsize) {
|
||||
break;
|
||||
}
|
||||
--$maxecl;
|
||||
}
|
||||
// check for automatic levels
|
||||
if (($ecl < 0) OR ($ecl > 8)) {
|
||||
if ($numcw < 41) {
|
||||
@@ -764,6 +754,16 @@ class PDF417 {
|
||||
$ecl = $maxecl;
|
||||
}
|
||||
}
|
||||
// get maximum correction level
|
||||
$maxecl = 8; // starting error level
|
||||
$maxerrsize = (928 - $numcw); // available codewords for error
|
||||
while ($maxecl > 0) {
|
||||
$errsize = (2 << $ecl);
|
||||
if ($maxerrsize >= $errsize) {
|
||||
break;
|
||||
}
|
||||
--$maxecl;
|
||||
}
|
||||
if ($ecl > $maxecl) {
|
||||
$ecl = $maxecl;
|
||||
}
|
||||
@@ -772,7 +772,7 @@ class PDF417 {
|
||||
|
||||
/**
|
||||
* Returns the error correction codewords
|
||||
* @param $cw (array) array of codewords including Symbol Lenght Descriptor and pad
|
||||
* @param $cw (array) array of codewords including Symbol Length Descriptor and pad
|
||||
* @param $ecl (int) error correction level 0-8
|
||||
* @return array of error correction codewords
|
||||
* @protected
|
||||
|
||||
Reference in New Issue
Block a user