This repository has been archived by the owner on Jun 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathmedialibrary.php
110 lines (97 loc) · 3.78 KB
/
medialibrary.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
<?php
return [
/*
* The filesystems on which to store added files and derived images by default. Choose
* one or more of the filesystems you configured in app/config/filesystems.php
*/
'disk_name' => 'media',
/*
* The maximum file size of an item in bytes. Adding a file
* that is larger will result in an exception.
*/
'max_file_size' => 1024 * 1024 * 10,
/*
* This queue will be used to generate derived images.
* Leave empty to use the default queue.
*/
'queue_name' => 'media_queue',
/*
* The class name of the media model to be used.
*/
'media_model' => Spatie\MediaLibrary\Models\Media::class,
/*
* The engine that will perform the image conversions.
* Should be either `gd` or `imagick`
*/
'image_driver' => 'gd',
/*
* When urls to files get generated this class will be called. Leave empty
* if your files are stored locally above the site root or on s3.
*/
'url_generator' => App\Services\Medialibrary\MediaLibraryUrlGenerator::class,
/*
* The class that contains the strategy for determining a media file's path.
*/
'path_generator' => null,
's3' => [
/*
* The domain that should be prepended when generating urls.
*/
'domain' => 'https://xxxxxxx.s3.amazonaws.com',
],
'remote' => [
/*
* Any extra headers that should be included when uploading media to
* a remote disk. Even though supported headers may vary between
* different drivers, a sensible default has been provided.
*
* Supported by S3: CacheControl, Expires, StorageClass,
* ServerSideEncryption, Metadata, ACL, ContentEncoding
*/
'extra_headers' => [
'CacheControl' => 'max-age=604800',
],
],
/*
* These generators will be used to created conversion of media files.
*/
'image_generators' => [
Spatie\MediaLibrary\ImageGenerators\FileTypes\Image::class,
Spatie\MediaLibrary\ImageGenerators\FileTypes\Pdf::class,
Spatie\MediaLibrary\ImageGenerators\FileTypes\Svg::class,
Spatie\MediaLibrary\ImageGenerators\FileTypes\Video::class,
],
/*
* Medialibrary will try to optimize all converted images by
* removing metadata and applying a little bit of compression. These are
* the optimizers that will be used by default.
*/
'image_optimizers' => [
Spatie\ImageOptimizer\Optimizers\Jpegoptim::class => [
'--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
],
Spatie\ImageOptimizer\Optimizers\Pngquant::class => [
'--force', // required parameter for this package
],
Spatie\ImageOptimizer\Optimizers\Optipng::class => [
'-i0', // this will result in a non-interlaced, progressive scanned image
'-o2', // this set the optimization level to two (multiple IDAT compression trials)
'-quiet', // required parameter for this package
],
Spatie\ImageOptimizer\Optimizers\Svgo::class => [
'--disable=cleanupIDs', // disabling because it is known to cause troubles
],
Spatie\ImageOptimizer\Optimizers\Gifsicle::class => [
'-b', // required parameter for this package
'-O3', // this produces the slowest but best results
],
],
/*
* FFMPEG & FFProbe binaries path, only used if you try to generate video
* thumbnails and have installed the php-ffmpeg/php-ffmpeg composer
* dependency.
*/
'ffmpeg_binaries' => '/usr/bin/ffmpeg',
'ffprobe_binaries' => '/usr/bin/ffprobe',
];