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

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

Scale the image object
public scale ( float | string $scl ) : Imagick
$scl float | string
Результат Imagick
    public function scale($scl)
    {
        // Determine the new width and height of the image based on the
        // value of the $scl argument.
        $this->setImageInfo();
        $wid = round($this->width * $scl);
        $hgt = round($this->height * $scl);
        // Create a new image output resource.
        $this->resource->resizeImage($wid, $hgt, $this->filter, $this->blur);
        $this->setImageInfo();
        return $this;
    }

Usage Example

Пример #1
0
 public function testScale()
 {
     $i = new Imagick(__DIR__ . '/../tmp/test.jpg');
     $i->scale(0.1);
     $this->assertEquals(64, $i->getWidth());
 }