Pop\Image\Imagick::setFormats PHP Метод

setFormats() публичный Метод

Set the current object formats to include the supported formats of Imagick.
public setFormats ( ) : Imagick
Результат Imagick
    public function setFormats()
    {
        $formats = $this->getFormats();
        foreach ($formats as $format) {
            $frmt = strtolower($format);
            if (!array_key_exists($frmt, $this->allowed)) {
                $this->allowed[$frmt] = 'image/' . $frmt;
            }
        }
        ksort($this->allowed);
        return $this;
    }

Usage Example

Пример #1
0
 public function testSetAndGetFormats()
 {
     $i = new Imagick(__DIR__ . '/../tmp/test.gif');
     $i->setFormats(array('gif' => 'image/gif'));
     $formats = $i->getFormats();
     $this->greaterThan(0, $i->getNumberOfFormats());
     $this->greaterThan(0, count($formats));
     $this->assertTrue(is_array($formats));
 }