Changeset 21764
- Timestamp:
- 2012/04/18 16:29:29 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/LC_Page_ResizeImage.php
r21515 r21764 52 52 */ 53 53 function process() { 54 $objThumb = new gdthumb(); 54 parent::process(); 55 $this->action(); 56 $this->sendResponse(); 57 } 58 59 /** 60 * Page のAction. 61 * 62 * @return void 63 */ 64 function action() { 65 $objFormParam = new SC_FormParam_Ex(); 66 $this->lfInitParam($objFormParam); 67 $objFormParam->setParam($_GET); 68 $arrForm = $objFormParam->getHashArray(); 55 69 56 70 $file = NO_IMAGE_REALFILE; 57 71 58 72 // NO_IMAGE_REALFILE以外のファイル名が渡された場合、ファイル名のチェックを行う 59 if (strlen($_GET['image']) >= 1 && $_GET['image'] !== NO_IMAGE_REALFILE) { 73 if (strlen($arrForm['image']) >= 1 74 && $arrForm['image'] !== NO_IMAGE_REALFILE) { 60 75 61 76 // ファイル名が正しく、ファイルが存在する場合だけ、$fileを設定 62 77 if (!$this->lfCheckFileName()) { 63 GC_Utils_Ex::gfPrintLog('invalid access :resize_image.php $_GET[\'image\']=' . $_GET['image']); 64 } 65 else if (file_exists(IMAGE_SAVE_REALDIR . $_GET['image'])) { 66 $file = IMAGE_SAVE_REALDIR . $_GET['image']; 78 GC_Utils_Ex::gfPrintLog('invalid access :resize_image.php image=' . $arrForm['image']); 79 } elseif (file_exists(IMAGE_SAVE_REALDIR . $arrForm['image'])) { 80 $file = IMAGE_SAVE_REALDIR . $arrForm['image']; 67 81 } 68 82 } 69 83 70 $objThumb->Main($file, $_GET['width'], $_GET['height'], '', true); 84 // リサイズ画像の出力 85 $this->lfOutputImage($file, $arrForm['width'], $arrForm['height']); 71 86 } 72 87 … … 78 93 function destroy() { 79 94 parent::destroy(); 95 } 96 97 function lfInitParam(&$objFormParam) { 98 $objFormParam->addParam('画像ファイル名', 'image', STEXT_LEN, 'a', array('MAX_LENGTH_CHECK')); 99 $objFormParam->addParam('画像の幅', 'width', STEXT_LEN, 'n', array('NUM_CHECK')); 100 $objFormParam->addParam('画像の高さ', 'width', STEXT_LEN, 'n', array('NUM_CHECK')); 80 101 } 81 102 … … 95 116 } 96 117 } 118 119 /** 120 * 画像の出力 121 * 122 * @param string $file 画像ファイル名 123 * @param integer $width 画像の幅 124 * @param integer $height 画像の高さ 125 * 126 * @return void 127 */ 128 function lfOutputImage($file, $width, $height) { 129 $objThumb = new gdthumb(); 130 $objThumb->Main($file, $width, $height, '', true); 131 } 97 132 }
Note: See TracChangeset
for help on using the changeset viewer.