Skip to content

Commit

Permalink
Updating robgridley/zebra to version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
stephandesouza committed Dec 14, 2020
1 parent adc11e2 commit 1cc97b4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 40 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"require": {
"php": "^7.3 || ^8",
"robgridley/zebra": "^1.0"
"robgridley/zebra": "^2.0"
},
"require-dev": {
"fzaninotto/faker": "^1.9.1",
Expand Down
54 changes: 28 additions & 26 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions src/Weez/Zpl/Exceptions/InvalidZebraImageException.php

This file was deleted.

8 changes: 3 additions & 5 deletions src/Weez/Zpl/Model/Element/ZebraImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Weez\Zpl\Model\Element;

use Weez\Zpl\Exceptions\InvalidZebraImageException;
use Weez\Zpl\Model\ZebraElement;
use Weez\Zpl\Utils\ZplUtils;
use Zebra\Zpl\GdDecoder;
use Zebra\Zpl\Image;

/**
Expand Down Expand Up @@ -37,10 +37,8 @@ class ZebraImage extends ZebraElement
*/
public function __construct($positionX, $positionY, $path, $compression = 'A')
{
if (!$image = file_get_contents($path)) {
throw new InvalidZebraImageException();
}
$this->resource = new Image($image);
$decoder = GdDecoder::fromPath($path);
$this->resource = new Image($decoder);
$this->compression = $compression;
$this->positionX = $positionX;
$this->positionY = $positionY;
Expand Down

0 comments on commit 1cc97b4

Please sign in to comment.