public function resizeCropCenter($width, $height)
{
$_width = $this->adapter->getWidth();
$_height = $this->adapter->getHeight();
if ($_width / $_height > $width / $height) {
$crop_height = $_height;
$crop_width = $width * $crop_height / $height;
$offsetX = ($_width - $crop_width) / 2;
$offsetY = 0;
} else {
$crop_width = $_width;
$crop_height = $height * $crop_width / $width;
$offsetY = ($_height - $crop_height) / 2;
$offsetX = 0;
}
$this->crop($crop_width, $crop_height, $offsetX, $offsetY);
$this->scale($width / $crop_width);
return $this;
}