コード例 #1
0
 /**
  * Set color image downsample type
  *
  * @param string $colorImageDownsampleType
  *
  * @throws \InvalidArgumentException
  *
  * @return $this
  */
 public function setColorImageDownsampleType($colorImageDownsampleType)
 {
     $colorImageDownsampleType = ltrim($colorImageDownsampleType, '/');
     if (!in_array($colorImageDownsampleType, ImageDownsampleType::values())) {
         throw new \InvalidArgumentException('Invalid color image downsample type argument');
     }
     $this->setArgument(sprintf('-dColorImageDownsampleType=/%s', $colorImageDownsampleType));
     return $this;
 }
コード例 #2
0
 public function testValues()
 {
     $values = [ImageDownsampleType::AVERAGE, ImageDownsampleType::BICUBIC, ImageDownsampleType::SUBSAMPLE, ImageDownsampleType::NONE];
     $this->assertEquals($values, ImageDownsampleType::values());
 }