diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-06-21 12:07:38 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-06-21 12:07:38 +0000 |
commit | cbacd1dc4c9debebf79a44c4a70747cb7baec207 (patch) | |
tree | 7fc68a39e3973e836617e125ba414204800f6d11 /actions/upload.php | |
parent | 9b44d58f4836a1e7c02a01ac249b25a9e0d75cb1 (diff) | |
download | elgg-cbacd1dc4c9debebf79a44c4a70747cb7baec207.tar.gz elgg-cbacd1dc4c9debebf79a44c4a70747cb7baec207.tar.bz2 |
final tweaks of gd upload code
Diffstat (limited to 'actions/upload.php')
-rw-r--r-- | actions/upload.php | 4 |
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'));
|