aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-12-29 11:49:11 +0100
committerMario <mario@mariovavti.com>2020-12-29 11:49:11 +0100
commitc84e3334bfb18fb90945a17d27b43bcb57ef4a1b (patch)
tree2ec86e2505c6b71f3b66d7983fa0188628e4a8f6
parentd5eeb948d51ac6619f89045984698d8d55bbb3f2 (diff)
parent36d89d02e13ed856de6bace89bfbed05205005db (diff)
downloadvolse-hubzilla-c84e3334bfb18fb90945a17d27b43bcb57ef4a1b.tar.gz
volse-hubzilla-c84e3334bfb18fb90945a17d27b43bcb57ef4a1b.tar.bz2
volse-hubzilla-c84e3334bfb18fb90945a17d27b43bcb57ef4a1b.zip
Merge branch 'tuneimagick' into 'dev'
Implement Imagemagick resources consumption limiting See merge request hubzilla/core!1888
-rw-r--r--include/photo/photo_driver.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index 52f761b65..f61919eea 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -38,6 +38,10 @@ function photo_factory($data, $type = null) {
$v = Imagick::getVersion();
preg_match('/ImageMagick ([0-9]+\.[0-9]+\.[0-9]+)/', $v['versionString'], $m);
if(version_compare($m[1], '6.6.7') >= 0) {
+ $limits = get_config('system', 'imagick_limits', false);
+ if ($limits)
+ foreach ($limits as $k => $v)
+ IMagick::setResourceLimit($k, $v);
$ph = new PhotoImagick($data, $type);
} else {
// earlier imagick versions have issues with scaling png's