- Timestamp:
- 2013/02/18 19:09:54 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/include/image_converter.inc
r21441 r22567 3 3 * 画像ファイルの変換を行う 4 4 */ 5 class ImageConverter { 5 class ImageConverter 6 { 6 7 var $outputImageDir; // 変換後の画像の保存先 7 8 var $outputImageType; // 変換後の画像の形式 … … 11 12 12 13 // コンストラクタ 13 function ImageConverter() { 14 function ImageConverter() 15 { 14 16 $this->outputImageDir = realpath(realpath(dirname(__FILE__))); 15 17 $this->outputImageType = 'jpg'; … … 20 22 21 23 // 変換実行 22 function execute($inputImagePath) { 24 function execute($inputImagePath) 25 { 23 26 // 前処理 24 27 $filestat = @stat($inputImagePath); … … 161 164 162 165 // Setter 163 function setOutputDir($outputDir) { $this->outputImageDir = $outputDir; } 164 function setImageType($imageType) { $this->outputImageType = $imageType; } 165 function setImageWidth($imageWidth) { $this->outputImageWidth = $imageWidth; } 166 function setImageHeight($imageHeight) { $this->outputImageHeight = $imageHeight; } 167 function setFileSize($fileSize) { $this->outputFileSize = $fileSize; } 166 function setOutputDir($outputDir) 167 { 168 $this->outputImageDir = $outputDir; 169 } 170 function setImageType($imageType) 171 { 172 $this->outputImageType = $imageType; 173 } 174 function setImageWidth($imageWidth) 175 { 176 $this->outputImageWidth = $imageWidth; 177 } 178 function setImageHeight($imageHeight) 179 { 180 $this->outputImageHeight = $imageHeight; 181 } 182 function setFileSize($fileSize) 183 { 184 $this->outputFileSize = $fileSize; 185 } 168 186 169 187 // Getter 170 function getOutputDir() { return $this->outputDir; } 171 function getImageType() { return $this->outputImageType; } 172 function getImageWidth() { return $this->outputImageWidth; } 173 function getImageHeight() { return $this->outputImageHeight; } 188 function getOutputDir() 189 { 190 return $this->outputDir; 191 } 192 function getImageType() 193 { 194 return $this->outputImageType; 195 } 196 function getImageWidth() 197 { 198 return $this->outputImageWidth; 199 } 200 function getImageHeight() 201 { 202 return $this->outputImageHeight; 203 } 174 204 175 205 /* 176 206 * PrivateMethod 177 207 */ 178 function beforeExecute() { 208 function beforeExecute() 209 { 179 210 } 180 211 … … 186 217 * @return array 色情報 187 218 */ 188 function getTransparentColor($image) { 219 function getTransparentColor($image) 220 { 189 221 $max_x = imagesx($image) - 1; 190 222 $max_y = imagesy($image) - 1;
Note: See TracChangeset
for help on using the changeset viewer.