summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpfspot.class.php6
1 files changed, 6 insertions, 0 deletions
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);
}