aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/config_default.inc.php4
-rw-r--r--include/constants.php2
-rw-r--r--include/functions.inc.php15
3 files changed, 21 insertions, 0 deletions
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index 60a3da323..ec0b58522 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -63,6 +63,10 @@ $conf['file_ext'] = array_merge(
array('tiff', 'tif', 'mpg','zip','avi','mp3','ogg','pdf')
);
+// format_ext : file extensions for formats, ie additional versions of a
+// photo (or nay other file). Formats are in sub-directory pwg_format.
+$conf['format_ext'] = array('cr2', 'tif', 'tiff', 'nef', 'dng', 'ai');
+
// top_number : number of element to display for "best rated" and "most
// visited" categories
$conf['top_number'] = 15;
diff --git a/include/constants.php b/include/constants.php
index 83d8747bc..ef321a4bc 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -105,5 +105,7 @@ if (!defined('THEMES_TABLE'))
define('THEMES_TABLE', $prefixeTable.'themes');
if (!defined('LANGUAGES_TABLE'))
define('LANGUAGES_TABLE', $prefixeTable.'languages');
+if (!defined('IMAGE_FORMAT_TABLE'))
+ define('IMAGE_FORMAT_TABLE', $prefixeTable.'image_format');
?>
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')