コード例 #1
0
ファイル: class.dc.media.php プロジェクト: HackerMajor/root
 protected function imageThumbUpdate(&$file, &$newFile)
 {
     if ($file->relname != $newFile->relname) {
         $p = path::info($file->relname);
         $thumb_old = sprintf($this->thumb_tp, $p['dirname'], $p['base'], '%s');
         $p = path::info($newFile->relname);
         $thumb_new = sprintf($this->thumb_tp, $p['dirname'], $p['base'], '%s');
         foreach ($this->thumb_sizes as $suffix => $s) {
             try {
                 parent::moveFile(sprintf($thumb_old, $suffix), sprintf($thumb_new, $suffix));
             } catch (Exception $e) {
             }
         }
     }
 }
コード例 #2
0
ファイル: class.dc.media.php プロジェクト: nikrou/dotclear
 protected function imageThumbUpdate($file, $newFile)
 {
     if ($file->relname != $newFile->relname) {
         $p = path::info($file->relname);
         $alpha = $p['extension'] == 'png' || $p['extension'] == 'PNG';
         $thumb_old = sprintf($alpha ? $this->thumb_tp_alpha : $this->thumb_tp, $p['dirname'], $p['base'], '%s');
         $p = path::info($newFile->relname);
         $alpha = $p['extension'] == 'png' || $p['extension'] == 'PNG';
         $thumb_new = sprintf($alpha ? $this->thumb_tp_alpha : $this->thumb_tp, $p['dirname'], $p['base'], '%s');
         foreach ($this->thumb_sizes as $suffix => $s) {
             try {
                 parent::moveFile(sprintf($thumb_old, $suffix), sprintf($thumb_new, $suffix));
             } catch (Exception $e) {
             }
         }
     }
 }