diff options
author | Max Kostikov <max@kostikov.co> | 2020-12-26 14:10:56 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2020-12-26 14:10:56 +0100 |
commit | 36d89d02e13ed856de6bace89bfbed05205005db (patch) | |
tree | 06ebb90adc04befab371a7c3332ea83d85bd0e40 | |
parent | f4bfa779425dc4f55db86bc554624bb05b09c49f (diff) | |
download | volse-hubzilla-36d89d02e13ed856de6bace89bfbed05205005db.tar.gz volse-hubzilla-36d89d02e13ed856de6bace89bfbed05205005db.tar.bz2 volse-hubzilla-36d89d02e13ed856de6bace89bfbed05205005db.zip |
Implement Imagemagick resources consumption limiting
-rw-r--r-- | include/photo/photo_driver.php | 4 |
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 |