aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-24 17:57:42 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-24 17:57:42 +0000
commitc660db3ef021dfff32a0289a635842e06659244c (patch)
tree6b5f0b28533587ef6d2ea81432b70af2be460d02 /engine/lib
parent3ffa4f4ef17d816438e7873b1233725a66341e30 (diff)
downloadelgg-c660db3ef021dfff32a0289a635842e06659244c.tar.gz
elgg-c660db3ef021dfff32a0289a635842e06659244c.tar.bz2
Serious memory optimisation for the photo resize functions
git-svn-id: https://code.elgg.org/elgg/trunk@1112 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/filestore.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php
index dcf802cd5..25befa449 100644
--- a/engine/lib/filestore.php
+++ b/engine/lib/filestore.php
@@ -622,9 +622,6 @@
// Get the size information from the image
if ($imgsizearray = getimagesize($input_name)) {
- // Get the contents of the file
- $filecontents = file_get_contents($input_name);
-
// Get width and height
$width = $imgsizearray[0];
$height = $imgsizearray[1];
@@ -656,7 +653,7 @@
$accepted_formats = array(
'image/jpeg' => 'jpeg',
'image/png' => 'png',
- 'image/gif' => 'png'
+ 'image/gif' => 'gif'
);
// If it's a file we can manipulate ...
@@ -664,7 +661,7 @@
$function = "imagecreatefrom" . $accepted_formats[$imgsizearray['mime']];
$newimage = imagecreatetruecolor($newwidth,$newheight);
-
+
if (is_callable($function) && $oldimage = $function($input_name)) {
// Crop the image if we need a square