public function resizeToWidth($wid)
{
$this->setImageInfo();
$scale = $wid / $this->width;
$hgt = round($this->height * $scale);
// Create a new image output resource.
$this->resource->resizeImage($wid, $hgt, $this->filter, $this->blur);
$this->setImageInfo();
return $this;
}