99 public function __call($name, $arguments)
101 $command = $this->driver->executeCommand($this, $name, $arguments);
102 return $command->hasOutput() ? $command->getOutput() : $this;
112 public function encode($format =
null, $quality = 90)
114 return $this->driver->encode($this, $format, $quality);
128 if (is_null(
$path)) {
130 "Can't write to undefined path."
134 $data = $this->
encode(pathinfo(
$path, PATHINFO_EXTENSION), $quality);
135 $saved = @file_put_contents(
$path, $data);
137 if ($saved ===
false) {
139 "Can't write image data to path ({$path})"
155 public function filter(Filters\FilterInterface $filter)
157 return $filter->applyFilter($this);
211 $name = is_null($name) ?
'default' : $name;
213 if ( ! $this->backupExists($name)) {
214 throw new \Intervention\Image\Exception\RuntimeException(
215 "Backup with name ({$name}) not available. Call backup() before reset()."
219 return $this->backups[$name];
241 $name = is_null($name) ?
'default' : $name;
243 $this->backups[$name] = $resource;
254 private function backupExists($name)
256 return array_key_exists($name, $this->backups);
266 return ! is_null($this->encoded);
286 $this->encoded = $value;
298 return $this->getSize()->width;
318 return $this->getSize()->height;
348 if ($this->dirname && $this->basename) {
349 return ($this->dirname .
'/'. $this->basename);
370 $this->core = $this->driver->cloneCore($this->core);