public function scaleByWidth($width, $forceResize = false)
{
if ($forceResize || $width <= $this->getWidth() || $this->isVectorGraphic()) {
$height = round($width / $this->getWidth() * $this->getHeight(), 0);
$this->resize(max(1, $width), max(1, $height));
}
return $this;
}