X-Git-Url: http://positon.org/gitweb/?p=bizou.git;a=blobdiff_plain;f=functions.php;fp=functions.php;h=ebad5041a7ac8b019fac0bdba4cb77d37902f4f3;hp=630be0004fc71fe1c88196b8d4d8284ee57c7908;hb=26887007f853d0a720d18592bf7c4fa86e6f68c7;hpb=c4491b6746923f941bea358f6bbbe9d40368a0f8 diff --git a/functions.php b/functions.php index 630be00..ebad504 100644 --- a/functions.php +++ b/functions.php @@ -67,7 +67,8 @@ function getPreview($imgFile, $maxSize = THUMB_SIZE) # config to allow group writable files umask(DATA_UMASK); # create the thumbs directory recursively - if (! is_dir(dirname($newImgFile))) mkdir(dirname($newImgFile), 0777, true); + if (! is_dir(dirname($newImgFile))) @mkdir(dirname($newImgFile), 0777, true) + or die("Could not write in data dir. Please fix permissions."); if ($w > $h) { $newW = $maxSize; @@ -108,7 +109,8 @@ function getAlbumPreview($dir) # config to allow group writable files umask(DATA_UMASK); # create the thumbs directory recursively - if (! is_dir(dirname($previewFile))) mkdir(dirname($previewFile), 0777, true); + if (! is_dir(dirname($previewFile))) @mkdir(dirname($previewFile), 0777, true) + or die("Could not write in data dir. Please fix permissions."); // no preview: look for a preview in current dir, write it, return it foreach (scandir($dir) as $file) if ($file[0] != '.') {