aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-06-21 12:07:38 +0000
committerCash Costello <cash.costello@gmail.com>2009-06-21 12:07:38 +0000
commitcbacd1dc4c9debebf79a44c4a70747cb7baec207 (patch)
tree7fc68a39e3973e836617e125ba414204800f6d11 /actions
parent9b44d58f4836a1e7c02a01ac249b25a9e0d75cb1 (diff)
downloadelgg-cbacd1dc4c9debebf79a44c4a70747cb7baec207.tar.gz
elgg-cbacd1dc4c9debebf79a44c4a70747cb7baec207.tar.bz2
final tweaks of gd upload code
Diffstat (limited to 'actions')
-rw-r--r--actions/upload.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/actions/upload.php b/actions/upload.php
index a297128c4..1b8776075 100644
--- a/actions/upload.php
+++ b/actions/upload.php
@@ -116,8 +116,8 @@
$mem_avail = rtrim($mem_avail, 'M');
$mem_avail = $mem_avail * 1024 * 1024;
if ($image_lib == 'GD') {
- $mem_required = 5 * $imginfo[0] * $imginfo[1];
- $mem_avail = $mem_avail - memory_get_peak_usage() - 4194304; // 4 MB buffer
+ $mem_required = ceil(5.35 * $imginfo[0] * $imginfo[1]);
+ $mem_avail = $mem_avail - memory_get_peak_usage() - 2097152; // 2 MB buffer
if ($mem_required > $mem_avail) {
array_push($not_uploaded, $sent_file['name']);
array_push($error_msgs, elgg_echo('tidypics:image_pixels'));