From d41a5a8b5f4b2cb3ec11c8402410dc6af83897db Mon Sep 17 00:00:00 2001 From: ngleader Date: Mon, 15 Jun 2009 08:11:10 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6548 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/file/conf/module.xml | 3 +-- modules/file/file.controller.php | 32 ++++++++++++++++++++++++++++++++ modules/file/tpl/iframe.html | 7 ++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/modules/file/conf/module.xml b/modules/file/conf/module.xml index c382cebb2..5f74ecf78 100644 --- a/modules/file/conf/module.xml +++ b/modules/file/conf/module.xml @@ -5,11 +5,10 @@ - - + diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 81b959df3..5ecc7a3fc 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -57,6 +57,11 @@ // 업로드 권한이 없거나 정보가 없을시 종료 if(!$_SESSION['upload_info'][$editor_sequence]->enabled) exit(); + $file_srl = Context::get('file_srl'); + if($file_srl){ + $this->deleteFile($file_srl); + } + // upload_target_srl 구함 $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; if(!$upload_target_srl) { @@ -81,6 +86,33 @@ } + /** + * @brief image resize + **/ + function procFileImageResize() { + $source_src = Context::get('source_src'); + $width = Context::get('width'); + $height = Context::get('height'); + $type = Context::get('type'); + $output_src = Context::get('output_src'); + + if(!$source_src || !$width) return new Object(-1,'msg_invalid_request'); + if(!$output_src){ + $output_src = $source_src . '.resized' . strrchr($source_src,'.'); + } + if(!$type) $type = 'ratio'; + if(!$height) $height = $width-1; + + if(FileHandler::createImageFile($source_src,$output_src,$width,$height,'','ratio')){ + $output->info = getimagesize($output_src); + $output->src = $output_src; + }else{ + return new Object(-1,'msg_invalid_request'); + } + + $this->add('resized_info',$output); + } + /** diff --git a/modules/file/tpl/iframe.html b/modules/file/tpl/iframe.html index c7ce135a5..1d38233f5 100644 --- a/modules/file/tpl/iframe.html +++ b/modules/file/tpl/iframe.html @@ -1,7 +1,8 @@