aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions.inc.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 7851021a3..537edc32a 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -215,6 +215,34 @@ function get_dirs($directory)
return $sub_dirs;
}
+/**
+ * returns thumbnail directory name of input diretoty name
+ * make thumbnail directory is necessary
+ * set error messages on array messages
+ *
+ * @param:
+ * string $dirname
+ * arrayy $errors
+ * @return bool false on error else string directory name
+ */
+function mkget_thumbnail_dir($dirname, &$errors)
+{
+ $tndir = $dirname.'/thumbnail';
+ if (!is_dir($tndir))
+ {
+ if (!is_writable($dirname))
+ {
+ array_push($errors,
+ '['.$dirname.'] : '.l10n('no_write_access'));
+ return false;
+ }
+ umask(0000);
+ mkdir($tndir, 0777);
+ }
+
+ return $tndir;
+}
+
// The get_picture_size function return an array containing :
// - $picture_size[0] : final width
// - $picture_size[1] : final height