aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/photos_add_direct_prepare.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-08-19 16:04:43 +0000
committerplegall <plg@piwigo.org>2011-08-19 16:04:43 +0000
commit24ab1e2467a178817735b9049e4a8a6612e13d41 (patch)
tree06977835881e5dbb82c72626c612873fa3d64607 /admin/include/photos_add_direct_prepare.inc.php
parent50cb55c65690f15b5bbc375af0b2bfa87400083d (diff)
feature 2410 added: uploadify upgraded from version 2.1.0 to 3.0.0 (still beta,
but said as stable by users on uploadify forums) bug 2411 fixed: thanks to uploadify 3.0.0, the "Browse" button is now localized (text in any language) bug 1653 fixed: if the selected file exceeds the upload_max_size (as defined in the php.ini), an alert is shown and the file is not added to the queue. bug 2412 fixed: ability to select GIF files with the Flash Uploader. git-svn-id: http://piwigo.org/svn/trunk@11975 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include/photos_add_direct_prepare.inc.php')
-rw-r--r--admin/include/photos_add_direct_prepare.inc.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/admin/include/photos_add_direct_prepare.inc.php b/admin/include/photos_add_direct_prepare.inc.php
index 34a5f79b7..50b1c0303 100644
--- a/admin/include/photos_add_direct_prepare.inc.php
+++ b/admin/include/photos_add_direct_prepare.inc.php
@@ -85,7 +85,12 @@ if (pwg_image::get_library() == 'gd')
$available_memory = get_ini_size('memory_limit') - memory_get_usage();
$max_upload_width = round(sqrt($available_memory/(2 * $fudge_factor)));
$max_upload_height = round(2 * $max_upload_width / 3);
- $max_upload_resolution = floor($max_upload_width * $max_upload_height / (1024 * 1024));
+
+ // we don't want dimensions like 2995x1992 but 3000x2000
+ $max_upload_width = round($max_upload_width/100)*100;
+ $max_upload_height = round($max_upload_height/100)*100;
+
+ $max_upload_resolution = floor($max_upload_width * $max_upload_height / (1000000));
// no need to display a limitation warning if the limitation is huge like 20MP
if ($max_upload_resolution < 25)