Example #1
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  */
 public function perform(Query $query)
 {
     $query->notWith('background', Query::ARGUMENT_TYPE_INPUT);
     if (Color::validColorName($this->color)) {
         $query->setInputOption(' -background ' . $this->color);
     } else {
         $query->setInputOption(' -background "' . $this->color . '"');
     }
     return $query;
 }
Example #2
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  */
 public function perform(Query $query)
 {
     $query->notWith('resample', Query::ARGUMENT_TYPE_INPUT);
     $query->notWith('resize', Query::ARGUMENT_TYPE_INPUT);
     $option = " -resample '";
     if ($this->newWidth != "" && $this->newHeight != "") {
         $option = $option . $this->newWidth . "x" . $this->newHeight;
     } elseif ($this->newWidth != "") {
         $option = $option . $this->newWidth;
     }
     $option = $option . "' ";
     $query->setInputOption($option);
     return $query;
 }
Example #3
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  */
 public function perform(Query $query)
 {
     $query->setInputOption(" -layers " . $this->method);
     return $query;
 }
Example #4
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  */
 public function perform(Query $query)
 {
     $query->notWith('rotate', Query::ARGUMENT_TYPE_INPUT);
     $query->setInputOption(' -rotate "' . $this->degree . '"');
     return $query;
 }
Example #5
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  */
 public function perform(Query $query)
 {
     $query->notWith('strip', Query::ARGUMENT_TYPE_INPUT);
     $query->setInputOption(" -strip ");
     return $query;
 }
Example #6
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  */
 public function perform(Query $query)
 {
     $query->notWith('polaroid', Query::ARGUMENT_TYPE_INPUT);
     $query->setInputOption(" -polaroid " . $this->angle . '');
     return $query;
 }
Example #7
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  * @throws \BadMethodCallException if density has already been called
  */
 public function perform(Query $query)
 {
     $query->notWith('density', Query::ARGUMENT_TYPE_INPUT);
     $query->notWith('density', Query::ARGUMENT_TYPE_OUTPUT);
     if ($this->output) {
         $query->setOutputOption(" -density " . $this->width . "x" . $this->height);
     } else {
         $query->setInputOption(" -density " . $this->width . "x" . $this->height);
     }
     return $query;
 }
Example #8
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  */
 public function perform(Query $query)
 {
     $query->notWith('resize', Query::ARGUMENT_TYPE_INPUT);
     $query->notWith('resample', Query::ARGUMENT_TYPE_INPUT);
     $option = " -resize ";
     if ($this->width != '') {
         $option .= $this->width;
     }
     if ($this->height != '') {
         $option .= "x" . $this->height;
     }
     if ($this->aspect == Resize::ASPECT_FILL) {
         $option .= "^";
     }
     if ($this->dontScaleUp) {
         $option .= "\\>";
     }
     if (!$this->maintainAspectRatio) {
         $option .= "!";
     }
     $option .= " ";
     $query->setInputOption($option);
     return $query;
 }
Example #9
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  */
 public function perform(Query $query)
 {
     $query->notWith('gravity', Query::ARGUMENT_TYPE_INPUT);
     $query->setInputOption(" -gravity " . $this->gravity);
     return $query;
 }
Example #10
0
 /**
  * (non-PHPdoc)
  *
  * @param Query $query
  *            The query to add the action to
  * @return Query
  * @see Action::perform()
  */
 public function perform(Query $query)
 {
     $query->notWith('size', Query::ARGUMENT_TYPE_INPUT);
     $query->setInputOption(" -size " . $this->width . "x" . $this->height . " ");
     return $query;
 }