diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-07-17 01:00:19 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-07-17 01:00:19 +0000 |
commit | 2a0b13d8668da50325dac33b21de1a376af28953 (patch) | |
tree | 68829d740a2f53da1c65ed63357daf1680c58798 /actions | |
parent | fba9d91ec8f173f0f3cc939eb70b94530c57151c (diff) | |
download | elgg-2a0b13d8668da50325dac33b21de1a376af28953.tar.gz elgg-2a0b13d8668da50325dac33b21de1a376af28953.tar.bz2 |
using memory_get_usage due to some people not having php 5.2
Diffstat (limited to 'actions')
-rw-r--r-- | actions/upload.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actions/upload.php b/actions/upload.php index b74f72c7b..6911978b0 100644 --- a/actions/upload.php +++ b/actions/upload.php @@ -116,7 +116,10 @@ $mem_avail = $mem_avail * 1024 * 1024;
if ($image_lib == 'GD') {
$mem_required = ceil(5.35 * $imginfo[0] * $imginfo[1]);
- $mem_avail = $mem_avail - memory_get_peak_usage() - 2097152; // 2 MB buffer
+
+ $mem_used = memory_get_usage();
+
+ $mem_avail = $mem_avail - $mem_used - 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'));
|