aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2015-12-03 16:04:02 +0100
committerplegall <plg@piwigo.org>2015-12-03 16:04:02 +0100
commit8e098d502a8f0e413b9c085db27d6a62a6c0909f (patch)
tree04bdf84e30becac7b8ed7b0b98fa7696b9979d5e /include/functions.inc.php
parent27389102d1275cdefcaee9c5a4a93297fc797b8c (diff)
feature #379 multiple format, step 1: add formats
* new table piwigo_image_format (each photo can have 0 to many formats) * only compatible with synchronization for now. Formats must be in sub-directory pwg_format * formats are visible on edition page only for now
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')