pixmicat

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/PIO/ @ 812  →  /PIO/ @ 813
/PIO/lib/pio/pio.logflockp.php
@@ -362,8 +362,10 @@
$arr_warn = $arr_kill = array();
foreach($rpord as $post){
$logsarray = $this->_ArrangeArrayStructure($post); // 分析資料為陣列
if($FileIO->imageExists($logsarray[0]['tim'].$logsarray[0]['ext'])){ $total_size -= $FileIO->getImageFilesize($logsarray[0]['tim'].$logsarray[0]['ext']) / 1024; $arr_kill[] = $post; $arr_warn[$post] = 1; } // 標記刪除
if($FileIO->imageExists($logsarray[0]['tim'].'s.jpg')) $total_size -= $FileIO->getImageFilesize($logsarray[0]['tim'].'s.jpg') / 1024;
$dfile = $logsarray[0]['tim'].$logsarray[0]['ext'];
$dthumb = $FileIO->resolveThumbName($logsarray[0]['tim']);
if($FileIO->imageExists($dfile)){ $total_size -= $FileIO->getImageFilesize($dfile) / 1024; $arr_kill[] = $post; $arr_warn[$post] = 1; } // 標記刪除
if($dthumb && $FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($total_size < $storage_max) break;
}
return $warnOnly ? $arr_warn : $this->removeAttachments($arr_kill);
@@ -409,8 +411,10 @@
$lcount = count($logsarray);
for($i = 0; $i < $lcount; $i++){
if($logsarray[$i]['ext']){
if($FileIO->imageExists($logsarray[$i]['tim'].$logsarray[$i]['ext'])) $files[] = $logsarray[$i]['tim'].$logsarray[$i]['ext'];
if($FileIO->imageExists($logsarray[$i]['tim'].'s.jpg')) $files[] = $logsarray[$i]['tim'].'s.jpg';
$dfile = $logsarray[$i]['tim'].$logsarray[$i]['ext'];
$dthumb = $FileIO->resolveThumbName($logsarray[$i]['tim']);
if($FileIO->imageExists($dfile)) $files[] = $dfile;
if($dthumb && $FileIO->imageExists($dthumb)) $files[] = $dthumb;
}
}
return $files;
/PIO/lib/pio/pio.log.php
@@ -354,8 +354,10 @@
$arr_warn = $arr_kill = array();
foreach($rpord as $post){
$logsarray = $this->_ArrangeArrayStructure($post); // 分析資料為陣列
if($FileIO->imageExists($logsarray[0]['tim'].$logsarray[0]['ext'])){ $total_size -= $FileIO->getImageFilesize($logsarray[0]['tim'].$logsarray[0]['ext']) / 1024; $arr_kill[] = $post; $arr_warn[$post] = 1; } // 標記刪除
if($FileIO->imageExists($logsarray[0]['tim'].'s.jpg')) $total_size -= $FileIO->getImageFilesize($logsarray[0]['tim'].'s.jpg') / 1024;
$dfile = $logsarray[0]['tim'].$logsarray[0]['ext'];
$dthumb = $FileIO->resolveThumbName($logsarray[0]['tim']);
if($FileIO->imageExists($dfile)){ $total_size -= $FileIO->getImageFilesize($dfile) / 1024; $arr_kill[] = $post; $arr_warn[$post] = 1; } // 標記刪除
if($dthumb && $FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($total_size < $storage_max) break;
}
return $warnOnly ? $arr_warn : $this->removeAttachments($arr_kill);
@@ -401,8 +403,10 @@
$lcount = count($logsarray);
for($i = 0; $i < $lcount; $i++){
if($logsarray[$i]['ext']){
if($FileIO->imageExists($logsarray[$i]['tim'].$logsarray[$i]['ext'])) $files[] = $logsarray[$i]['tim'].$logsarray[$i]['ext'];
if($FileIO->imageExists($logsarray[$i]['tim'].'s.jpg')) $files[] = $logsarray[$i]['tim'].'s.jpg';
$dfile = $logsarray[$i]['tim'].$logsarray[$i]['ext'];
$dthumb = $FileIO->resolveThumbName($logsarray[$i]['tim']);
if($FileIO->imageExists($dfile)) $files[] = $dfile;
if($dthumb && $FileIO->imageExists($dthumb)) $files[] = $dthumb;
}
}
return $files;
/PIO/lib/pio/pio.sqlite.php
@@ -271,9 +271,9 @@
array('Get the old post failed', __LINE__));
while(list($dno, $dext, $dtim) = sqlite_fetch_array($result)){ // 個別跑舊文迴圈
$dfile = $dtim.$dext; // 附加檔案名稱
$dthumb = $dtim.'s.jpg'; // 預覽檔案名稱
$dthumb = $FileIO->resolveThumbName($dtim); // 預覽檔案名稱
if($FileIO->imageExists($dfile)){ $total_size -= $FileIO->getImageFilesize($dfile) / 1024; $arr_kill[] = $dno; $arr_warn[$dno] = 1; } // 標記刪除
if($FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($dthumb && $FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($total_size < $storage_max) break;
}
return $warnOnly ? $arr_warn : $this->removeAttachments($arr_kill);
@@ -305,9 +305,9 @@
$result = $this->_sqlite_call($tmpSQL, array('Get attachments of the post failed', __LINE__));
while(list($dext, $dtim) = sqlite_fetch_array($result)){ // 個別跑迴圈
$dfile = $dtim.$dext; // 附加檔案名稱
$dthumb = $dtim.'s.jpg'; // 預覽檔案名稱
$dthumb = $FileIO->resolveThumbName($dtim); // 預覽檔案名稱
if($FileIO->imageExists($dfile)) $files[] = $dfile;
if($FileIO->imageExists($dthumb)) $files[] = $dthumb;
if($dthumb && $FileIO->imageExists($dthumb)) $files[] = $dthumb;
}
return $files;
}
/PIO/lib/pio/pio.sqlite3.php
@@ -252,9 +252,9 @@
$arr_warn = $arr_kill = array(); // 警告 / 即將被刪除標記
($result = $this->con->query('SELECT no,ext,tim FROM '.$this->tablename.' WHERE ext <> "" ORDER BY no')) or $this->_error_handler('Get the old post failed', __LINE__);
while(list($dno, $dext, $dtim) = $result->fetch(PDO::FETCH_NUM)){
$dfile = $dtim.$dext; $dthumb = $dtim.'s.jpg';
$dfile = $dtim.$dext; $dthumb = $FileIO->resolveThumbName($dtim);
if($FileIO->imageExists($dfile)){ $total_size -= $FileIO->getImageFilesize($dfile) / 1024; $arr_kill[] = $dno; $arr_warn[$dno] = 1; } // 標記刪除
if($FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($dthumb && $FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($total_size < $storage_max) break;
}
return $warnOnly ? $arr_warn : $this->removeAttachments($arr_kill);
@@ -282,9 +282,9 @@
 
($result = $this->con->query($tmpSQL)) or $this->_error_handler('Get attachments of the post failed', __LINE__);
while(list($dext, $dtim) = $result->fetch(PDO::FETCH_NUM)){
$dfile = $dtim.$dext; $dthumb = $dtim.'s.jpg';
$dfile = $dtim.$dext; $dthumb = $FileIO->resolveThumbName($dtim);
if($FileIO->imageExists($dfile)) $files[] = $dfile;
if($FileIO->imageExists($dthumb)) $files[] = $dthumb;
if($dthumb && $FileIO->imageExists($dthumb)) $files[] = $dthumb;
}
return $files;
}
/PIO/lib/pio/pio.mysql.php
@@ -305,9 +305,9 @@
array('Get old posts failed', __LINE__));
while(list($dno, $dext, $dtim) = mysql_fetch_row($result)){ // 個別跑舊文迴圈
$dfile = $dtim.$dext; // 附加檔案名稱
$dthumb = $dtim.'s.jpg'; // 預覽檔案名稱
$dthumb = $FileIO->resolveThumbName($dtim); // 預覽檔案名稱
if($FileIO->imageExists($dfile)){ $total_size -= $FileIO->getImageFilesize($dfile) / 1024; $arr_kill[] = $dno; $arr_warn[$dno] = 1; } // 標記刪除
if($FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($dthumb && $FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($total_size < $storage_max) break;
}
mysql_free_result($result);
@@ -340,9 +340,9 @@
$result = $this->_mysql_call($tmpSQL, array('Get attachments of the post failed', __LINE__));
while(list($dext, $dtim) = mysql_fetch_row($result)){ // 個別跑迴圈
$dfile = $dtim.$dext; // 附加檔案名稱
$dthumb = $dtim.'s.jpg'; // 預覽檔案名稱
$dthumb = $FileIO->resolveThumbName($dtim); // 預覽檔案名稱
if($FileIO->imageExists($dfile)) $files[] = $dfile;
if($FileIO->imageExists($dthumb)) $files[] = $dthumb;
if($dthumb && $FileIO->imageExists($dthumb)) $files[] = $dthumb;
}
mysql_free_result($result);
return $files;
/PIO/lib/pio/pio.pgsql.php
@@ -286,9 +286,9 @@
array('Get the old post failed', __LINE__));
while(list($dno, $dext, $dtim) = pg_fetch_array($result)){ // 個別跑舊文迴圈
$dfile = $dtim.$dext; // 附加檔案名稱
$dthumb = $dtim.'s.jpg'; // 預覽檔案名稱
$dthumb = $FileIO->resolveThumbName($dtim); // 預覽檔案名稱
if($FileIO->imageExists($dfile)){ $total_size -= $FileIO->getImageFilesize($dfile) / 1024; $arr_kill[] = $dno; $arr_warn[$dno] = 1; } // 標記刪除
if($FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($dthumb && $FileIO->imageExists($dthumb)) $total_size -= $FileIO->getImageFilesize($dthumb) / 1024;
if($total_size < $storage_max) break;
}
pg_free_result($result);
@@ -321,9 +321,9 @@
$result = $this->_pgsql_call($tmpSQL, array('Get attachments of the post failed', __LINE__));
while(list($dext, $dtim) = pg_fetch_array($result)){ // 個別跑迴圈
$dfile = $dtim.$dext; // 附加檔案名稱
$dthumb = $dtim.'s.jpg'; // 預覽檔案名稱
$dthumb = $FileIO->resolveThumbName($dtim); // 預覽檔案名稱
if($FileIO->imageExists($dfile)) $files[] = $dfile;
if($FileIO->imageExists($dthumb)) $files[] = $dthumb;
if($dthumb && $FileIO->imageExists($dthumb)) $files[] = $dthumb;
}
pg_free_result($result);
return $files;
/PIO/lib/thumb/thumb.gd.php
@@ -237,7 +237,18 @@
if(!$im_in) return false;
$im_out = ImageCreateTrueColor($this->thumbWidth, $this->thumbHeight);
ImageCopyResampled($im_out, $im_in, 0, 0, 0, 0, $this->thumbWidth, $this->thumbHeight, $this->sourceWidth, $this->sourceHeight);
ImageJPEG($im_out, $destFile, $this->thumbQuality);
switch(strtolower($this->thumbSetting['Format'])){
case 'png':
ImagePNG($im_out, $destFile, $this->thumbQuality);
break;
case 'gif':
ImageGIF($im_out, $destFile);
break;
case 'jpg':
default:
ImageJPEG($im_out, $destFile, $this->thumbQuality);
break;
}
ImageDestroy($im_in); ImageDestroy($im_out);
return true;
}
/PIO/lib/lib_fileio.php
@@ -18,7 +18,7 @@
function getImageLocalURL($imgname){
if(!isset($this->absoluteURL)) $this->absoluteURL = $this->_getAbsoluteURL();
 
return $this->absoluteURL.(substr($imgname, -5)=='s.jpg' ? THUMB_DIR : IMG_DIR).$imgname;
return $this->absoluteURL.(strpos($imgname, 's.') !== false ? THUMB_DIR : IMG_DIR).$imgname;
}
 
/* 檢查遠端檔案是否存在 */
/PIO/ChangeLog
@@ -1,5 +1,9 @@
Pixmicat!-PIO 修改紀錄
----------------------
2011/05/16
-[PIO][FileIO] 修正依賴 s.jpg 查詢預覽圖的敘述
-[thumb.gd] 新增 PNG, GIF 格式預覽圖生成
 
2011/04/13, 14
-[thumb] 預覽圖生成物件修改為準備可支援其他圖像格式
-[config] 整合預覽圖生成設定 $THUMB_SETTING