Skip to content

Commit

Permalink
Merge pull request php-imagine#174 from romainneutron/GDLayers
Browse files Browse the repository at this point in the history
Instantiate GD layers only when it is required
  • Loading branch information
avalanche123 committed Dec 13, 2012
2 parents 6ffcf25 + 0d199a0 commit 9d644b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Imagine/Gd/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ final class Image implements ImageInterface
public function __construct($resource)
{
$this->resource = $resource;
$this->layers = new Layers($this, $this->resource);
}

/**
Expand Down Expand Up @@ -474,6 +473,10 @@ public function getColorAt(PointInterface $point)
*/
public function layers()
{
if (null === $this->layers) {
$this->layers = new Layers($this, $this->resource);
}

return $this->layers;
}

Expand Down

0 comments on commit 9d644b6

Please sign in to comment.