innomedio / sulu-image-optimizer-bundle
在Sulu媒体库中上传和存储之前优化图像
v2.0
2024-05-27 06:35 UTC
Requires
- php: ^8.2
- jackalope/jackalope-doctrine-dbal: ^2.0
- spatie/image-optimizer: ^1.6
- sulu/sulu: ^2.6
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpro/grumphp: ^2.4
- phpstan/phpstan: ^1.10
This package is auto-updated.
Last update: 2024-09-27 07:24:33 UTC
README
由于服务器/托管限制,您可能在使用Sulu裁剪非常大的图像(大小或像素)时遇到问题。
此捆绑包在将图像添加到Sulu媒体库之前对其进行优化(和/或调整大小),以便它们更容易处理。
安装
使用composer安装
composer require innomedio/sulu-image-optimizer-bundle
如果尚未自动添加,请将捆绑包添加到config/bundles.php
Innomedio\Sulu\ImageOptimizerBundle\InnomedioSuluImageOptimizerBundle::class => ['all' => true],
用法
安装后,图像优化和调整大小默认启用。以下是可用的设置
innomedio_sulu_image_optimizer:
enabled: true
resize:
enabled: true
max_size: 4000 # Means if the width or height > 4000, the image will be resized to 4000
如果您想记录所有发生的事情,可以像这样定义您的记录器
innomedio_sulu_image_optimizer:
logger: 'monolog.logger.YOUR_CHANNEL'