public function resize($width, $height)
{
if (version_compare(PHP_VERSION, '5.5.0') < 0) {
$image = imagecreatetruecolor($width, $height);
imagealphablending($image, false);
imagesavealpha($image, true);
imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $this->_width, $this->_height);
} else {
$image = imagescale($this->_image, $width, $height);
}
imagedestroy($this->_image);
$this->_image = $image;
$this->_width = imagesx($image);
$this->_height = imagesy($image);
return $this;
}