public function resizeAndKeepAspect($widthOrDimensions, $height = null, $useResampling = true) {
		if(is_object($widthOrDimensions) && $widthOrDimensions instanceof Dimensions) {
			$y = $widthOrDimensions->height;
			$x = $widthOrDimensions->width;
		} else {
			$x = $widthOrDimensions;
			$y = $height;
		}

		$originalAspect = $this->width / $this->height;
		$newAspect = $x / $y;

		if($originalAspect !== $newAspect) {
			if($originalAspect > $newAspect) {
				$ratio = $x / $this->width;
				$y = $ratio * $this->height;
			} else {
				$ratio = $y / $this->height;
				$x = $ratio * $this->width;
			}
		}

		return $this->resize($x, $y, $useResampling);
	}