Пример #1
0
 /**
  * Construct a new size action
  *
  * @param \Karla\Program $program
  *            The program to use
  * @param string $colorspace
  *            Colorspace
  *
  * @throws \InvalidArgumentException If he supplied colorspace is not supported by imagemagick.
  */
 public function __construct($program, $colorspace)
 {
     if (!Support::colorSpace($program, $colorspace)) {
         $message = 'The supplied colorspace (' . $colorspace . ') is not supported by imagemagick';
         throw new \InvalidArgumentException($message);
     }
     $this->colorspace = $colorspace;
 }
Пример #2
0
 /**
  * Contruct new action
  *
  * @param \Karla\Program $program
  *            The program to use
  * @param string $method
  *            Method
  *
  * @throws \InvalidArgumentException If the supplied method is not supported by imagemagick.
  */
 public function __construct($program, $method)
 {
     if (!Support::layerMethod($program, $method)) {
         $message = 'The supplied method (' . $method . ') is not supported by imagemagick';
         throw new \InvalidArgumentException($message);
     }
     $this->method = $method;
 }
Пример #3
0
 /**
  * Construct a new gravity action
  *
  * @param \Karla\Program $program
  *            The program to use
  * @param string $gravity
  *            Gravity
  *
  * @throws \InvalidArgumentException If the supplied gravity is not supported by imagemagick.
  */
 public function __construct($program, $gravity)
 {
     if (!Support::gravity($program, $gravity)) {
         $message = 'The supplied gravity (' . $gravity . ') is not supported by imagemagick';
         throw new \InvalidArgumentException($message);
     }
     $this->gravity = $gravity;
 }