Changeset 18007 for branches/version-2/data/include
- Timestamp:
- 2009/05/15 16:30:40 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/include/image_converter.inc
r15079 r18007 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.