Changeset 15078 for branches/feature-module-update/data/class/SC_Image.php
- Timestamp:
- 2007/07/20 15:58:59 (19 years ago)
- Location:
- branches/feature-module-update
- Files:
-
- 1 edited
- 2 copied
-
. (copied) (copied from branches/rel) (1 prop)
-
data (copied) (copied from branches/rel/data)
-
data/class/SC_Image.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update
-
Property
svn:ignore
set to
.cache
.settings
.projectOptions
-
Property
svn:ignore
set to
-
branches/feature-module-update/data/class/SC_Image.php
r12157 r15078 6 6 */ 7 7 8 //---- ¥¢¥Ã¥×¥í¡¼¥É¥Õ¥¡¥¤¥ë²Ã¹©¥¯¥é¥¹(thumb.php¤È¥»¥Ã¥È¤Ç»ÈÍѤ¹¤ë)8 //---- アップロードファイル加工クラス(thumb.phpとセットで使用する) 9 9 class SC_Image { 10 10 … … 12 12 13 13 function SC_Image($tmp_dir) { 14 // ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëÆÉ¹þ14 // ヘッダファイル読込 15 15 $include_dir = realpath(dirname( __FILE__)); 16 16 require_once($include_dir . "/../lib/thumb.php"); … … 22 22 } 23 23 24 //--- °ì»þ¥Õ¥¡¥¤¥ëÀ¸À®(¥µ¥à¥Í¥¤¥ë²èÁüÀ¸À®ÍÑ)24 //--- 一時ファイル生成(サムネイル画像生成用) 25 25 function makeTempImage($keyname, $max_width, $max_height) { 26 // °ì°Õ¤ÊID¤ò¼èÆÀ¤¹¤ë¡£26 // 一意なIDを取得する。 27 27 $mainname = uniqid("")."."; 28 // ³ÈÄ¥»Ò°Ê³°¤òÃÖ¤´¹¤¨¤ë¡£28 // 拡張子以外を置き換える。 29 29 $newFileName = ereg_replace("^.*\.",$mainname, $_FILES[$keyname]['name']); 30 30 $result = MakeThumb($_FILES[$keyname]['tmp_name'], $this->tmp_dir , $max_width, $max_height, $newFileName); … … 33 33 } 34 34 35 //--- ¥Õ¥¡¥¤¥ë¤ò»ØÄêÊݸDIR¤Ø°Üư35 //--- ファイルを指定保存DIRへ移動 36 36 function moveTempImage($filename, $save_dir) { 37 // ¥³¥Ô¡¼¸µ¥Õ¥¡¥¤¥ë¡¢¥³¥Ô¡¼Àè¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Î¤ß¼Â¹Ô¤¹¤ë37 // コピー元ファイル、コピー先ディレクトリが存在する場合にのみ実行する 38 38 if(file_exists($this->tmp_dir.$filename) && file_exists($save_dir)) { 39 39 if(copy($this->tmp_dir . $filename , $save_dir."/".$filename)) { … … 41 41 } 42 42 } else { 43 gfDebugLog($this->tmp_dir.$filename." ¤Î°Üư¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");43 gfDebugLog($this->tmp_dir.$filename."の移動に失敗しました。"); 44 44 } 45 45 } 46 46 47 //---- »ØÄê¥Õ¥¡¥¤¥ë¤òºï½ü47 //---- 指定ファイルを削除 48 48 function deleteImage($filename, $dir) { 49 49 if(file_exists($dir."/".$filename)) {
Note: See TracChangeset
for help on using the changeset viewer.
