/** * Fit image in to given size * http://php.net/manual/en/imagick.resizeimage.php * @param resurce $image Imagick object * @param int $w width * @param int $h height * * @return resurce imagick object */ protected function imageFit($image, $w, $h) { //resize - works slower but have a better quality //$image->resizeImage($w, $h, $this->resize_filter, 1, true); //scale - work fast, but without any quality configuration $image->scaleImage($w, $h, true); return $image; }