aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions.inc.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 60a1885e5..e1658c31f 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -953,6 +953,21 @@ function original_to_representative($path, $representative_ext)
}
/**
+ * Transforms an original path to its format
+ *
+ * @param string $path
+ * @param string $format_ext
+ * @return string
+ */
+function original_to_format($path, $format_ext)
+{
+ $pos = strrpos($path, '/');
+ $path = substr_replace($path, 'pwg_format/', $pos+1, 0);
+ $pos = strrpos($path, '.');
+ return substr_replace($path, $format_ext, $pos+1);
+}
+
+/**
* get the full path of an image
*
* @param array $element_info element information from db (at least 'path')