aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/include/photos_add_direct_prepare.inc.php26
-rw-r--r--admin/themes/default/template/photos_add_direct.tpl3
2 files changed, 11 insertions, 18 deletions
diff --git a/admin/include/photos_add_direct_prepare.inc.php b/admin/include/photos_add_direct_prepare.inc.php
index 4d852fee4..a795247e3 100644
--- a/admin/include/photos_add_direct_prepare.inc.php
+++ b/admin/include/photos_add_direct_prepare.inc.php
@@ -25,25 +25,9 @@
// | Photo selection |
// +-----------------------------------------------------------------------+
-$upload_max_filesize = min(
- get_ini_size('upload_max_filesize'),
- get_ini_size('post_max_size')
- );
-
-if ($upload_max_filesize == get_ini_size('upload_max_filesize'))
-{
- $upload_max_filesize_shorthand = get_ini_size('upload_max_filesize', false);
-}
-else
-{
- $upload_max_filesize_shorthand = get_ini_size('post_max_filesize', false);
-}
-
$template->assign(
array(
'F_ADD_ACTION'=> PHOTOS_ADD_BASE_URL,
- 'upload_max_filesize' => $upload_max_filesize,
- 'upload_max_filesize_shorthand' => $upload_max_filesize_shorthand,
'chunk_size' => $conf['upload_form_chunk_size'],
)
);
@@ -222,6 +206,16 @@ if (!isset($_SESSION['upload_hide_warnings']))
get_ini_size('post_max_size', false)
);
}
+
+ if (get_ini_size('upload_max_filesize') < $conf['upload_form_chunk_size']*1024)
+ {
+ $setup_warnings[] = sprintf(
+ 'Piwigo setting upload_form_chunk_size (%ukB) should be smaller than PHP configuration setting upload_max_filesize (%ukB)',
+ $conf['upload_form_chunk_size'],
+ ceil(get_ini_size('upload_max_filesize') / 1024)
+ );
+ }
+
$template->assign(
array(
'setup_warnings' => $setup_warnings,
diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl
index 71663fc20..decd3e2b3 100644
--- a/admin/themes/default/template/photos_add_direct.tpl
+++ b/admin/themes/default/template/photos_add_direct.tpl
@@ -282,10 +282,9 @@ jQuery(document).ready(function(){
<p class="uploadInfo">{'The picture dimensions will be reduced to %dx%d pixels.'|@translate:$original_resize_maxwidth:$original_resize_maxheight}</p>
{/if}
- <p id="uploadWarningsSummary">{$upload_max_filesize_shorthand}B. {$upload_file_types}. {if isset($max_upload_resolution)}{$max_upload_resolution}Mpx{/if} <a class="icon-info-circled-1 showInfo" title="{'Learn more'|@translate}"></a></p>
+ <p id="uploadWarningsSummary">{$upload_file_types}. {if isset($max_upload_resolution)}{$max_upload_resolution}Mpx{/if} <a class="icon-info-circled-1 showInfo" title="{'Learn more'|@translate}"></a></p>
<p id="uploadWarnings">
- {'Maximum file size: %sB.'|@translate:$upload_max_filesize_shorthand}
{'Allowed file types: %s.'|@translate:$upload_file_types}
{if isset($max_upload_resolution)}
{'Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).'|@translate:$max_upload_resolution:$max_upload_width:$max_upload_height}