HumHub : Compression d’image …

119 x served & 36 x viewed

J’ai pu voir dans la documentation que c’était possible : https://docs.humhub.org/docs/admin/uploads/ . A noter que j’utilise la version : 1.8.2.

J’ai donc modifié la configuration dans /var/www/humhub/protected/config/common.php :

<?php
/**
* This file provides to overwrite the default HumHub / Yii configuration by your local common (Console and Web) environments
* @see http://www.yiiframework.com/doc-2.0/guide-concept-configurations.html
* @see http://docs.humhub.org/admin-installation-configuration.html
* @see http://docs.humhub.org/dev-environment.html
*/
return [
'modules' => [
'file' => [
'imageMaxResolution' => '1920x1080',
'imageJpegQuality' => 75,
'imagePngCompressionLevel' => 9,
'imageWebpQuality' => 75,
]
]
];

Ensuite j’ai lancé la commande :

# sudo su
# /usr/bin/php /var/www/humhub/protected/yii file/downscale-images
*** File module console

Downscaling uploaded files:....

Afin de compresser les images précédentes, mais j’ai eu un crash :

Exception 'Imagine\Exception\RuntimeException' with message 'Resize operation failed'

in humhub/protected/vendor/imagine/imagine/src/Imagick/Image.php:295

Caused by: #ff0000;">Exception 'ImagickException' with message 'cache resources exhausted ...

in /humhub/protected/vendor/imagine/imagine/src/Imagick/Image.php:292

Stack trace:
#0 /humhub/protected/vendor/imagine/imagine/src/Imagick/Image.php(292): Imagick->resizeimage(1920, 2560, 0, 1)
#1 /humhub/protected/humhub/modules/file/libs/ImageHelper.php(129): Imagine\Imagick\Image->resize(Object(Imagine\Image\Box))
#2 /humhub/protected/humhub/modules/file/commands/FileController.php(93): humhub\modules\file\libs\ImageHelper::downscaleImage(Object(humhub\modules\file\models\File))
#3 [internal function]: humhub\modules\file\commands\FileController->actionDownscaleImages()
#4 /humhub/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#5 /humhub/protected/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#6 /humhub/protected/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction('downscale-image...', Array)
#7 /humhub/protected/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction('downscale-image...', Array)
#8 /humhub/protected/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction('file/downscale-...', Array)
#9 /humhub/protected/vendor/yiisoft/yii2/console/Application.php(148): yii\console\Application->runAction('file/downscale-...', Array)
#10 /humhub/protected/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest(Object(yii\console\Request))
#11 /humhub/protected/yii(29): yii\base\Application->run()
#12 {main}

J’ai donc modifié le fichier /etc/ImageMagick-6/policy.xml :

<policy domain="resource" name="disk" value="8GiB"/>

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée.

Time limit is exhausted. Please reload CAPTCHA.