summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-06-26 12:09:13 +0200
committerandi <andi@splitbrain.org>2005-06-26 12:09:13 +0200
commit98407a7ab8cdc6e868009187f47cc7768449a3c9 (patch)
tree81ff92e45a1ec0db93dadbbf24fbab1f17cea434 /lib
parentd477fdcf1c8e21ef479942fe1d14acb7991d8a4a (diff)
downloadrpg-98407a7ab8cdc6e868009187f47cc7768449a3c9.tar.gz
rpg-98407a7ab8cdc6e868009187f47cc7768449a3c9.tar.bz2
directory cleanup
This cleans up the directory structure as discussed on the mailning list. Users should delete their previous _cache directories to recover diskspace. darcs-hash:20050626100913-9977f-83c0fdc32047db2090fc52a843ffae50cbf12248.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/exe/fetch.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php
index fffbf4483..384ff2d32 100644
--- a/lib/exe/fetch.php
+++ b/lib/exe/fetch.php
@@ -101,13 +101,12 @@
function get_resized($file, $ext, $w, $h=0){
global $conf;
- $md5 = md5($file);
$info = getimagesize($file);
if(!$h) $h = round(($w * $info[1]) / $info[0]);
//cache
- $local = $conf['mediadir'].'/_cache/'.$md5.'.'.$w.'x'.$h.'.'.$ext;
+ $local = getCacheName($file,'.media.'.$w.'x'.$h.'.'.$ext);
$mtime = @filemtime($local); // 0 if not exists
if( $mtime > filemtime($file) || resize_image($ext,$file,$info[0],$info[1],$local,$w,$h) ){
@@ -144,9 +143,7 @@ function get_from_URL($url,$ext,$cache){
global $conf;
$url = strtolower($url);
- $md5 = md5($url);
-
- $local = $conf['mediadir']."/_cache/$md5.$ext";
+ $local = getCacheName($url,".media.$ext");
$mtime = @filemtime($local); // 0 if not exists
//decide if download needed:
@@ -204,7 +201,7 @@ function resize_image($ext,$from,$from_w,$from_h,$to,$to_w,$to_h){
}
// create cachedir
- io_makeFileDir($to);
+ //io_makeFileDir($to); // not needed anymore, should exist
//try resampling first
if(function_exists("imagecopyresampled")){