/** * gets the shell command to be executed * @see phMagick\Core.Action::getShellCommand() */ public function getShellCommand() { $command = new Command(); $command->binary('convert')->file($this->getSource()); if ($this->optimize) { $command->option('-strip'); } if (null !== $this->quality) { $command->param('-quality', $this->quality); } $command->file($this->getDestination()); return $command; }
/** * gets the shell command to be executed * @see phMagick\Core.Action::getShellCommand() */ public function getShellCommand() { $command = new Command(); $width = $this->getWidth(); $height = $this->getHeight(); if ($width < 0) { throw new \InvalidArgumentException('With must not be negative'); } if ($height < 0) { throw new \InvalidArgumentException('Height must not be negative'); } if ($width == 0 && $height == 0) { throw new \InvalidArgumentException('width and height must be greater than 0'); } $command->binary('convert')->file($this->getSource())->param('-scale', $width . 'x' . $height . '!')->file($this->getDestination()); return $command; }
public function getShellCommand() { $command = new Command(); $transparency = $this->getTransparency(); $watermark = $this->getWatermarkImage(); $gravity = $this->getGravity(); $command->binary('composite')->param('-dissolve', $transparency)->param('-gravity', $gravity, true)->file($watermark)->file($this->getSource())->file($this->getDestination()); return $command; }
public function getShellCommand() { $command = new Command(); $width = $this->getWidth(); if (is_null($width)) { throw new \InvalidArgumentException('please specify width'); } $height = $this->getHeight(); if (is_null($height)) { throw new \InvalidArgumentException('please specify height'); } $top = $this->getTop(); $left = $this->getLeft(); $gravity = $this->getGravity(); $command->binary('convert')->file($this->getSource())->param('-gravity', $gravity, true)->param('-crop', $width . 'x' . $height . '+' . $left . '+' . $top)->file($this->getDestination()); return $command; }