Fix: Console image converter memory limit allocation

This commit is contained in:
Lucas Bartholemy 2017-03-16 14:31:16 +01:00
parent 3ad27444f3
commit e9d81a80f6
2 changed files with 7 additions and 0 deletions

View File

@ -73,6 +73,7 @@ HumHub Change Log
- Enh: Directory view templates cleanups
- Fix: All LDAP Users have been disabled and not reenabled by hourly cronjob if ldap server not reachable.
- Enh: Cleanup authentication layout file
- Fix: Console image converter memory limit allocation
1.2.0-beta.2 (February 24, 2017)
--------------------------------

View File

@ -114,6 +114,12 @@ class ImageConverter
list ($width, $height) = getimagesize($sourceFile);
// get defined memory limit from php_ini
$memoryLimit = ini_get('memory_limit');
// No memory limit set
if ($memoryLimit == -1) {
return;
}
// calc needed size for processing image dimensions in Bytes.
$neededMemory = floor(($width * $height * $bytesPerPixel * $tweakFactor + 1048576) / 1048576);
$maxMemoryAllocation = Yii::$app->getModule('file')->settings->get(self::SETTINGS_NAME_MAX_MEMORY_ALLOCATION);