diff --git a/SimpleImage.class.php b/SimpleImage.class.php
index <HASH>..<HASH> 100755
--- a/SimpleImage.class.php
+++ b/SimpleImage.class.php
@@ -300,6 +300,9 @@ class SimpleImage {
 	//

 	public function best_fit($max_width, $max_height) {

 		

+		// If it already fits, there's nothing to do

+		if( $this->width <= $max_width && $this->height <= $max_height ) return $this;

+		

 		// Determine aspect ratio

 		$aspect_ratio = $this->height / $this->width;
Added check in best_fit() so no scaling will take place if the image already fits.