Created
June 9, 2015 14:29
-
-
Save alpharder/526e4bc0b0cb65afb984 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/functions/fn.images.php b/app/functions/fn.images.php | |
index 02892d2..44072fa 100644 | |
--- a/app/functions/fn.images.php | |
+++ b/app/functions/fn.images.php | |
@@ -649,6 +649,8 @@ function fn_resize_image($src, $new_width = 0, $new_height = 0, $bg_color = '#ff | |
$thumbnail = $canvas; | |
} | |
+ unset($image); | |
+ | |
$format = $settings['convert_to']; | |
if ($format === 'original') { | |
@@ -665,9 +667,16 @@ function fn_resize_image($src, $new_width = 0, $new_height = 0, $bg_color = '#ff | |
'filter' => $filter | |
); | |
- return array($thumbnail->get($format, $options), $format); | |
+ $return = array($thumbnail->get($format, $options), $format); | |
+ | |
+ unset($thumbnail); | |
+ gc_collect_cycles(); | |
+ | |
+ return $return; | |
} catch (\Exception $e) { | |
+ gc_collect_cycles(); | |
+ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment