Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request zendframework/zendframework#5864 from jaapio/barco…
Browse files Browse the repository at this point in the history
…de_code_check

patch zendframework/zendframework#5860 barcode analyzer fixes
  • Loading branch information
weierophinney committed Mar 5, 2014
170 parents 4381d40 + 8afd3ba + 2d33c4d + 4aebbda + a47e3ed + ddb35c9 + 8a05e9b + a92be28 + 5d9546f + 644a1db + 1008053 + c0d0bfc + ab83210 + 88be4ef + e672b58 + c5c6433 + a6b0c4e + 28d72f0 + 48c143c + acee230 + 9a49788 + efd47ef + 8dad02c + 9be7abf + bf9e60b + a03898c + 025fb19 + 6551ff4 + e5066db + 30065eb + cd23bdb + f518ed9 + 54153cf + e4984e8 + cc9c920 + b3042ce + e57fd9d + d07707d + 60d87e0 + dea915e + 4f2f391 + e61f957 + a301eb4 + 86ee99c + 4f18442 + 0560233 + 803be33 + b3b44b2 + 747588e + ff0efd2 + 5651d65 + a3fbf6b + 2a0a9d7 + e987caa + f6cf6f8 + a97175a + 18ecd64 + f00b78e + 18be569 + af6e96a + a62b890 + 369a5ce + 2f4d803 + 045137d + 2fdcee4 + 147c99e + d95685a + 9fceeb6 + 4682ed8 + 58e6c7d + f9a818b + b470c79 + ce259b2 + 47e8c8b + 62bd37a + f6216bb + 01cd418 + 1d5008a + f7d1866 + 339c91f + 105863b + d697919 + a07d04f + ab69e95 + a01fec1 + 79aa858 + e6c1f7b + caa3725 + 42e5478 + 2d5d2cd + 80ddcc5 + e2d6bae + 4d230a7 + eb81fcd + d11d08b + 260e6bd + 7ad155b + 5fc070f + c78a364 + 4941bab + c4245dd + b4f05cd + a274d7e + 9ddc5d3 + b327453 + 4fb6bdc + 589d10e + 1190c26 + 7a8c4e6 + 34dd90e + 181ab3e + 67215df + 3722470 + 760ae55 + 71ba5e4 + 0e69738 + 5fee79a + edb69b7 + affa8ee + b842366 + 8bcb41c + 2d61aeb + 3e577bd + 2912cc2 + 480b09d + 9ef4bbd + a9fbb32 + a3442c5 + 3ba9ec5 + 249bcf9 + 17f4e58 + f5df8ff + 09c6fb7 + 244cca2 + e70f1f7 + c0ba5d9 + af32048 + e486343 + 2925378 + 7987d36 + f33a6b9 + ccec312 + c6e5159 + 5686261 + 032f44f + c050df1 + c5316e9 + e3aa8e4 + c5faeb8 + 8cb76ea + d3e8682 + ebc5f97 + fee3d00 + 89b4efe + aabf76f + d2e2f88 + fff768a + f13d677 + f094f08 + d90409d + 111c229 + 35b35e9 + 15d7ed8 + f72bde6 + 0e2bc7a + 9fb4637 + 54946f9 + 55f205f + 0996891 + 63f3963 commit fcc368e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Object/Codabar.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ protected function checkSpecificParams()
protected function prepareBarcode()
{
$text = str_split($this->getText());
$barcodeTable = array();
foreach ($text as $char) {
$barcodeChar = str_split($this->codingMap[$char]);
foreach ($barcodeChar as $c) {
Expand Down
3 changes: 1 addition & 2 deletions src/Object/Code128.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ protected function convertToBarcodeChars($string)
$strlen = strlen($string);
for ($pos = 0; $pos < $strlen; $pos++) {
$char = $string[$pos];
$code = null;

if (static::_isDigit($string, $pos, 4) && $currentCharset != 'C'
|| static::_isDigit($string, $pos, 2) && $currentCharset == 'C') {
Expand Down Expand Up @@ -248,7 +247,7 @@ protected function convertToBarcodeChars($string)
if ($pos == 0) {
$code = array_search("START A", $this->charSets['A']);
} else {
$code =array_search("Code A", $this->charSets[$currentCharset]);
$code = array_search("Code A", $this->charSets[$currentCharset]);
}
$result[] = $code;
$currentCharset = 'A';
Expand Down
2 changes: 2 additions & 0 deletions src/Object/Code25interleaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ protected function prepareBarcode()
if ($this->withBearerBars) {
$this->withBorder = false;
}

$barcodeTable = array();

// Start character (0000)
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
Expand Down
2 changes: 2 additions & 0 deletions src/Renderer/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ protected function initRenderer()
protected function drawPolygon($points, $color, $filled = true)
{
$page = $this->resource->pages[$this->page];
$x = array();
$y = array();
foreach ($points as $point) {
$x[] = $point[0] * $this->moduleSize + $this->leftOffset;
$y[] = $page->getHeight() - $point[1] * $this->moduleSize - $this->topOffset;
Expand Down
3 changes: 2 additions & 1 deletion src/Renderer/Svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@ protected function drawPolygon($points, $color, $filled = true)
$points[3][1] + $this->topOffset - sin($orientation),
);
$newPoints = implode(' ', $newPoints);
$attributes = array();
$attributes['points'] = $newPoints;
$attributes['fill'] = $color;

// SVG passes a rect in as the first call to drawPolygon, we'll need to intercept
// this and set transparency if necessary.
$objId = spl_object_hash($this);
if(!$this->drawPolygonExecuted) {
if($this->transparentBackground) {
$attributes['fill-opacity'] = '0';
Expand All @@ -351,6 +351,7 @@ protected function drawText($text, $size, $position, $font, $color, $alignment =
$color = 'rgb(' . implode(', ', array(($color & 0xFF0000) >> 16,
($color & 0x00FF00) >> 8,
($color & 0x0000FF))) . ')';
$attributes = array();
$attributes['x'] = $position[0] + $this->leftOffset;
$attributes['y'] = $position[1] + $this->topOffset;
//$attributes['font-family'] = $font;
Expand Down

0 comments on commit fcc368e

Please sign in to comment.