Пример #1
0
 protected function _resize($width, $height = null, $keepar = true, $pad = true)
 {
     extract(parent::_resize($width, $height, $keepar, $pad));
     $image = '"' . $this->image_temp . '"';
     $this->exec('convert', "-define png:size=" . $cwidth . "x" . $cheight . " " . $image . " " . "-background none " . "-resize \"" . ($pad ? $width : $cwidth) . "x" . ($pad ? $height : $cheight) . "!\" " . "-gravity center " . "-extent " . $cwidth . "x" . $cheight . " " . $image);
     $this->clear_sizes();
 }
Пример #2
0
 protected function _resize($width, $height = null, $keepar = true, $pad = true)
 {
     extract(parent::_resize($width, $height, $keepar, $pad));
     $this->imagick->scaleImage($width, $height, $keepar);
     if ($pad) {
         $tmpimage = new Fuel_Imagick();
         $tmpimage->newImage($cwidth, $cheight, $this->create_color('#000', 0), 'png');
         $tmpimage->compositeImage($this->imagick, Fuel_Imagick::COMPOSITE_DEFAULT, ($cwidth - $width) / 2, ($cheight - $height) / 2);
         $this->imagick = $tmpimage;
     }
 }