From e439de1612eb471571c5a1503fba7f6531a90c08 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 22 Dec 2015 19:04:00 +0100 Subject: feature #379, multiple format, consider the original as a format --- picture.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'picture.php') diff --git a/picture.php b/picture.php index 75b7cdaf2..d88e6e262 100644 --- a/picture.php +++ b/picture.php @@ -674,10 +674,23 @@ SELECT * if (!empty($formats)) { + // let's add the original as a format among others. It will just have + // a specific download URL + array_unshift( + $formats, + array( + 'download_url' => $picture['current']['download_url'], + 'ext' => get_extension($picture['current']['file']), + 'filesize' => $picture['current']['filesize'], + ) + ); + foreach ($formats as &$format) { - $format['download_url'] = 'action.php?format='.$format['format_id']; - $format['download_url'].= '&download'; + if (!isset($format['download_url'])) + { + $format['download_url'] = 'action.php?format='.$format['format_id'].'&download'; + } $format['label'] = strtoupper($format['ext']); $lang_key = 'format '.strtoupper($format['ext']); -- cgit v1.2.3