public function cropPercent($width, $height, $x, $y)
{
if ($this->isVectorGraphic()) {
// rasterize before cropping
$dimensions = $this->getVectorRasterDimensions();
$this->resize($dimensions["width"], $dimensions["height"]);
}
$originalWidth = $this->getWidth();
$originalHeight = $this->getHeight();
$widthPixel = ceil($originalWidth * ($width / 100));
$heightPixel = ceil($originalHeight * ($height / 100));
$xPixel = ceil($originalWidth * ($x / 100));
$yPixel = ceil($originalHeight * ($y / 100));
return $this->crop($xPixel, $yPixel, $widthPixel, $heightPixel);
}