-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
config.php
234 lines (211 loc) · 7.06 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?php
/**
* ImageOptimize plugin for Craft CMS
*
* Automatically optimize images after they've been transformed
*
* @link https://nystudio107.com
* @copyright Copyright (c) 2017 nystudio107
*/
use nystudio107\imageoptimize\imagetransforms\CraftImageTransform;
/**
* ImageOptimize config.php
*
* This file exists only as a template for the ImageOptimize settings.
* It does nothing on its own.
*
* Don't edit this file, instead copy it to 'craft/config' as
* 'image-optimize.php' and make your changes there to override default
* settings.
*
* Once copied to 'craft/config', this file will be multi-environment aware as
* well, so you can have different settings groups for each environment, just
* as
* you do for 'general.php'
*/
return [
// The image transform class to use for image transforms
'transformClass' => CraftImageTransform::class,
/**
* @var array Settings for the image transform components
*
* The data is stored in the following format, with the key being the class
* of the image transform method:
*
* 'imageTransformTypeSettings' => [
* ImgixImageTransform::class => [
* 'domain' => 'XXXXX',
* 'apiKey' => 'XXXXX',
* 'securityToken' => 'XXXXX',
* ]
* ],
*/
'imageTransformTypeSettings' => [],
// Should the image variants in an Asset Volume be automatically re-saved when saving
// an OptimizedImages field, saving an Asset Volume that has an OptimizedImages field
// in its layout, or saving the ImageOptimized settings. Set this to false only if
// you will be manually using the CLI console command to resave image variants
'automaticallyResaveImageVariants' => true,
// Should image variant be created on Asset save (aka BeforePageLoad)
'generateTransformsBeforePageLoad' => true,
// Set to false to disable all placeholder generation
'generatePlaceholders' => true,
// Whether the placeholder silhouette SVGs should be capped at 32Kb in size
'capSilhouetteSvgSize' => true,
// Controls whether a dominant color palette should be created for image variants
// It takes a bit of time, so if you never plan to use it, you can turn it off
'createColorPalette' => true,
// Controls whether SVG placeholder silhouettes should be created for image variants
// It takes a bit of time, so if you never plan to use them, you can turn it off
'createPlaceholderSilhouettes' => false,
// Controls whether retina images are automatically created with reduced quality
// as per https://www.netvlies.nl/blogs/retina-revolutie-follow
'lowerQualityRetinaImageVariants' => true,
// Controls whether Optimized Image Variants are created that would be up-scaled
// to be larger than the original source image
'allowUpScaledImageVariants' => false,
// Controls whether images scaled down >= 50% should be automatically sharpened
'autoSharpenScaledImages' => true,
// The amount an image needs to be scaled down for automatic sharpening to be applied
'sharpenScaledImagePercentage' => 50,
// Whether to allow limiting the creation of Optimized Image Variants for images by sub-folders
'assetVolumeSubFolders' => true,
// The default Image Transform type classes
'defaultImageTransformTypes' => [
],
// Default aspect ratios
'defaultAspectRatios' => [
['x' => 16, 'y' => 9],
['x' => 8, 'y' => 5],
['x' => 4, 'y' => 3],
['x' => 5, 'y' => 4],
['x' => 1, 'y' => 1],
['x' => 9, 'y' => 16],
['x' => 5, 'y' => 8],
['x' => 3, 'y' => 4],
['x' => 4, 'y' => 5],
],
// Default image variants
'defaultVariants' => [
[
'width' => 1200,
'useAspectRatio' => true,
'aspectRatioX' => 16.0,
'aspectRatioY' => 9.0,
'retinaSizes' => ['1'],
'quality' => 82,
'format' => 'jpg',
],
[
'width' => 992,
'useAspectRatio' => true,
'aspectRatioX' => 16.0,
'aspectRatioY' => 9.0,
'retinaSizes' => ['1'],
'quality' => 82,
'format' => 'jpg',
],
[
'width' => 768,
'useAspectRatio' => true,
'aspectRatioX' => 4.0,
'aspectRatioY' => 3.0,
'retinaSizes' => ['1'],
'quality' => 60,
'format' => 'jpg',
],
[
'width' => 576,
'useAspectRatio' => true,
'aspectRatioX' => 4.0,
'aspectRatioY' => 3.0,
'retinaSizes' => ['1'],
'quality' => 60,
'format' => 'jpg',
],
],
// Active image processors
'activeImageProcessors' => [
'jpg' => [
'jpegoptim',
],
'png' => [
'optipng',
],
'svg' => [
'svgo',
],
'gif' => [
'gifsicle',
],
],
// Active image variant creators
'activeImageVariantCreators' => [
'jpg' => [
'cwebp',
],
'png' => [
'cwebp',
],
'gif' => [
'cwebp',
],
],
// Preset image processors
'imageProcessors' => [
// jpeg optimizers
'jpegoptim' => [
'commandPath' => '/usr/bin/jpegoptim',
'commandOptions' => '-s',
'commandOutputFileFlag' => '',
],
'mozjpeg' => [
'commandPath' => '/usr/bin/mozjpeg',
'commandOptions' => '-optimize -copy none',
'commandOutputFileFlag' => '-outfile',
],
'jpegtran' => [
'commandPath' => '/usr/bin/jpegtran',
'commandOptions' => '-optimize -copy none',
'commandOutputFileFlag' => '',
],
// png optimizers
'optipng' => [
'commandPath' => '/usr/bin/optipng',
'commandOptions' => '-o3 -strip all',
'commandOutputFileFlag' => '',
],
'pngcrush' => [
'commandPath' => '/usr/bin/pngcrush',
'commandOptions' => '-brute -ow',
'commandOutputFileFlag' => '',
],
'pngquant' => [
'commandPath' => '/usr/bin/pngquant',
'commandOptions' => '--strip--skip -if-larger',
'commandOutputFileFlag' => '',
],
// svg optimizers
'svgo' => [
'commandPath' => '/usr/bin/svgo',
'commandOptions' => '',
'commandOutputFileFlag' => '',
],
// gif optimizers
'gifsicle' => [
'commandPath' => '/usr/bin/gifsicle',
'commandOptions' => '-O3 -k 256',
'commandOutputFileFlag' => '',
],
],
'imageVariantCreators' => [
// webp variant creator
'cwebp' => [
'commandPath' => '/usr/bin/cwebp',
'commandOptions' => '',
'commandOutputFileFlag' => '-o',
'commandQualityFlag' => '-q',
'imageVariantExtension' => 'webp',
],
],
];