Index: /branches/version-2_4/data/class/SC_MobileImage.php
===================================================================
--- /branches/version-2_4/data/class/SC_MobileImage.php	(revision 17733)
+++ /branches/version-2_4/data/class/SC_MobileImage.php	(revision 18006)
@@ -59,4 +59,5 @@
                     $imageType     = $data[6];
                     $imageWidth    = $data[5];
+                    $imageHeight   = $data[4];
                     break;
                 }
@@ -85,4 +86,5 @@
             $imageConverter->setImageType($imageType);
             $imageConverter->setImageWidth($imageWidth);
+            $imageConverter->setImageHeight($imageHeight);
             $imageConverter->setFileSize($imageFileSize);
 
Index: /branches/version-2_4/data/include/image_converter.inc
===================================================================
--- /branches/version-2_4/data/include/image_converter.inc	(revision 15079)
+++ /branches/version-2_4/data/include/image_converter.inc	(revision 18006)
@@ -30,7 +30,27 @@
 		$outputImagePath  = $this->outputImageDir . '/' . $outputImageName;
 
-		// 変換後の画像の高さが指定されていない場合、変換後の画像の横幅から求める
 		if (is_null($this->outputImageHeight)) {
-			$this->outputImageHeight = $inputImageHeight * ($this->outputImageWidth / $inputImageWidth);
+		  $height_was_null = TRUE;
+		  $this->outputImageHeight = $inputImageHeight * ($this->outputImageWidth / $inputImageWidth);
+		} else {
+		  $height_was_null = FALSE;
+		}
+		if ($inputImageWidth <= $this->outputImageWidth) {
+		  if ($inputImageHeight <= $this->outputImageHeight) {
+		    $this->outputImageWidth  = $inputImageWidth;
+		    $this->outputImageHeight = $inputImageHeight;
+		  } else {
+		    $this->outputImageWidth = $inputImageWidth * ($this->outputImageHeight / $inputImageHeight);
+		  }
+		} else {
+		  if ($inputImageHeight <= $this->outputImageHeight) {
+		    $this->outputImageHeight = $inputImageHeight * ($this->outputImageWidth / $inputImageWidth);
+		  } else {
+		    if ($this->outputImageWidth / $inputImageWidth < $this->outputImageHeight / $inputImageHeight) {
+		      $this->outputImageHeight = $inputImageHeight * ($this->outputImageWidth / $inputImageWidth);
+		    } else {
+		      $this->outputImageWidth = $inputImageWidth * ($this->outputImageHeight / $inputImageHeight);
+		    }
+		  }
 		}
 
@@ -127,6 +147,6 @@
 	function setImageType($imageType)   { $this->outputImageType  = $imageType;  }
 	function setImageWidth($imageWidth) { $this->outputImageWidth = $imageWidth; }
+	function setImageHeight($imageHeight) { $this->outputImageHeight = $imageHeight; }
 	function setFileSize($fileSize)     { $this->outputFileSize   = $fileSize;   }
-	// function setImageHeight($imageHeight) { $this->outputImageHeight = $imageHeight; }
 
 	// Getter
