owner->height > $maxHeight) return $this->owner->CroppedImage($this->owner->width, $maxHeight); return $this->owner; } /** * Crop an image if it exceeds a certain width. * Use in templates e.g. $Image.SetHeight(200).MaxWidth(200) * * @param integer $maxWidth Max width of image * @return Image */ public function MaxWidth($maxWidth) { if ($this->owner->width > $maxWidth) return $this->owner->CroppedImage($maxWidth, $this->owner->height); return $this->owner; } }