From af297e166b77efb1746f1d396b404102e0f89e15 Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sun, 20 Jan 2008 16:38:17 +0100 Subject: [PATCH] check if thumbnail-directory is writeable Signed-off-by: Andreas Unterkircher --- phpfspot.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpfspot.class.php b/phpfspot.class.php index b4d8b17..088e74d 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -88,6 +88,11 @@ class PHPFSPOT { exit(1); } + if(!is_writeable($this->cfg->thumb_path)) { + print $this->cfg->thumb_path .": directory is not writeable for user ". $this->getuid() ."\n"; + exit(1); + } + $this->cfg_db = new PHPFSPOT_DB($this, $this->cfg->phpfspot_db); if(!is_writeable($this->cfg->phpfspot_db)) { print $this->cfg->phpfspot_db ." is not writeable for user ". $this->getuid() ."\n"; @@ -1377,6 +1382,7 @@ class PHPFSPOT { $thumb_sub_path = substr($file_md5, 0, 2); $thumb_path = $this->cfg->thumb_path ."/". $thumb_sub_path ."/". $resolution ."_". $file_md5; + /* if thumbnail-subdirectory does not exist yet, create it */ if(!file_exists(dirname($thumb_path))) { mkdir(dirname($thumb_path), 0755); } -- 2.25.1