1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-27 18:26:50 +00:00
pixelfed/config/image-optimizer.php

54 lines
1.7 KiB
PHP
Raw Normal View History

2018-05-20 03:05:42 +00:00
<?php
use Spatie\ImageOptimizer\Optimizers\Gifsicle;
use Spatie\ImageOptimizer\Optimizers\Jpegoptim;
2018-08-28 03:07:36 +00:00
use Spatie\ImageOptimizer\Optimizers\Optipng;
use Spatie\ImageOptimizer\Optimizers\Pngquant;
use Spatie\ImageOptimizer\Optimizers\Svgo;
2018-05-20 03:05:42 +00:00
return [
/*
* When calling `optimize` the package will automatically determine which optimizers
* should run for the given image.
*/
'optimizers' => [
Jpegoptim::class => [
2021-09-04 04:09:58 +00:00
'-m' . (int) env('IMAGE_QUALITY', 80),
2018-05-20 03:05:42 +00:00
'--strip-all', // this strips out all text information such as comments and EXIF data
'--all-progressive', // this will make sure the resulting image is a progressive one
],
Pngquant::class => [
'--force', // required parameter for this package
],
Optipng::class => [
'-i0', // this will result in a non-interlaced, progressive scanned image
'-o7', // this set the optimization level to two (multiple IDAT compression trials)
'-strip all',
'-quiet', // required parameter for this package
],
Svgo::class => [
'--disable=cleanupIDs', // disabling because it is know to cause troubles
],
Gifsicle::class => [
'-b', // required parameter for this package
'-O3', // this produces the slowest but best results
],
],
/*
* The maximum time in seconds each optimizer is allowed to run separately.
*/
2020-01-29 04:32:09 +00:00
'timeout' => 59,
2018-05-20 03:05:42 +00:00
/*
* If set to `true` all output of the optimizer binaries will be appended to the default log.
* You can also set this to a class that implements `Psr\Log\LoggerInterface`.
*/
'log_optimizer_activity' => false,
2018-05-20 03:05:42 +00:00
];