コード例 #1
0
 /**
  * @return string
  */
 public function __toString()
 {
     $string = '-auto-orient';
     if ($this->command->width() || $this->command->height()) {
         $string .= ' -resize ' . $this->command->width() . 'x' . $this->command->height();
     }
     if (!is_null($this->command->background())) {
         $string .= ' -background "#' . $this->command->background() . '" -flatten';
     }
     if ($this->command->canvasWidth() || $this->command->canvasHeight()) {
         $string .= ' -size ' . $this->command->canvasWidth() . 'x' . $this->command->canvasHeight() . ' xc:#' . $this->canvasColor() . ' +swap -gravity center -composite';
     }
     if (!is_null($this->command->quality())) {
         $string .= ' -quality ' . $this->command->quality();
     }
     if (!is_null($this->command->colorspace())) {
         $string .= ' -colorspace ' . $this->command->colorspace();
     }
     return $string;
 }