Skip to content

Commit

Permalink
Fix EPS upside down issue
Browse files Browse the repository at this point in the history
  • Loading branch information
endroid committed Jun 2, 2020
1 parent 5c8fe17 commit a7e07d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Writer/EpsWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public function writeString(QrCodeInterface $qrCode): string
$epsData[] = '0 0 '.$data['outer_width'].' '.$data['outer_height'].' F';
$epsData[] = number_format($qrCode->getForegroundColor()['r'] / 100, 2, '.', ',').' '.number_format($qrCode->getForegroundColor()['g'] / 100, 2, '.', ',').' '.number_format($qrCode->getForegroundColor()['b'] / 100, 2, '.', ',').' setrgbcolor';

// Please note an EPS has a reversed Y axis compared to PNG and SVG
$data['matrix'] = array_reverse($data['matrix']);
foreach ($data['matrix'] as $row => $values) {
foreach ($values as $column => $value) {
if (1 === $value) {
Expand Down

0 comments on commit a7e07d2

Please sign in to comment.