Skip to content

Commit

Permalink
Add way to retrieve decode image contents - #1
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed Mar 4, 2021
1 parent 141640c commit da0db87
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Entity/Shipment/PackageResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ public function labelImage(): string
return LabelImage::class;
}

public function getDecodedImageContent(): null|string
{
if (! $this->label_image->graphic_image) {
return null;
}

return base64_decode($this->label_image->graphic_image);
}

public function storeLabel(): null|string
{
$disk = Config::get('ups.label_storage_disk', 'default');
Expand Down

0 comments on commit da0db87

Please sign in to comment.