Changeset 18085
- Timestamp:
- 2009/06/09 22:21:00 (14 years ago)
- Location:
- branches/comu-ver2/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/SC_MobileImage.php
r17917 r18085 59 59 $imageType = $data[6]; 60 60 $imageWidth = $data[5]; 61 $imageHeight = $data[4]; 61 62 break; 62 63 } … … 85 86 $imageConverter->setImageType($imageType); 86 87 $imageConverter->setImageWidth($imageWidth); 88 $imageConverter->setImageHeight($imageHeight); 87 89 $imageConverter->setFileSize($imageFileSize); 88 90 -
branches/comu-ver2/data/include/image_converter.inc
r15079 r18085 30 30 $outputImagePath = $this->outputImageDir . '/' . $outputImageName; 31 31 32 // 変換後の画像の高さが指定されていない場合、変換後の画像の横幅から求める33 32 if (is_null($this->outputImageHeight)) { 34 $this->outputImageHeight = $inputImageHeight * ($this->outputImageWidth / $inputImageWidth); 33 $height_was_null = TRUE; 34 $this->outputImageHeight = $inputImageHeight * ($this->outputImageWidth / $inputImageWidth); 35 } else { 36 $height_was_null = FALSE; 37 } 38 if ($inputImageWidth <= $this->outputImageWidth) { 39 if ($inputImageHeight <= $this->outputImageHeight) { 40 $this->outputImageWidth = $inputImageWidth; 41 $this->outputImageHeight = $inputImageHeight; 42 } else { 43 $this->outputImageWidth = $inputImageWidth * ($this->outputImageHeight / $inputImageHeight); 44 } 45 } else { 46 if ($inputImageHeight <= $this->outputImageHeight) { 47 $this->outputImageHeight = $inputImageHeight * ($this->outputImageWidth / $inputImageWidth); 48 } else { 49 if ($this->outputImageWidth / $inputImageWidth < $this->outputImageHeight / $inputImageHeight) { 50 $this->outputImageHeight = $inputImageHeight * ($this->outputImageWidth / $inputImageWidth); 51 } else { 52 $this->outputImageWidth = $inputImageWidth * ($this->outputImageHeight / $inputImageHeight); 53 } 54 } 35 55 } 36 56 … … 127 147 function setImageType($imageType) { $this->outputImageType = $imageType; } 128 148 function setImageWidth($imageWidth) { $this->outputImageWidth = $imageWidth; } 149 function setImageHeight($imageHeight) { $this->outputImageHeight = $imageHeight; } 129 150 function setFileSize($fileSize) { $this->outputFileSize = $fileSize; } 130 // function setImageHeight($imageHeight) { $this->outputImageHeight = $imageHeight; }131 151 132 152 // Getter
Note: See TracChangeset
for help on using the changeset viewer.