/** * Scales the image proportionally to a width * * @param int $width * * @throws \InvalidArgumentException * @return void */ public function scaleToWidth($width) { if (!self::isValidImageDimension($width)) { throw new \InvalidArgumentException('Width and Height must be integer > 0.'); } $height = (int) round($width / $this->image->getWidth() * $this->image->getHeight()); $this->image->scaleToDimensions($width, $height); }