-
Notifications
You must be signed in to change notification settings - Fork 80
/
image.php
173 lines (146 loc) · 5.82 KB
/
image.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
<?php
return [
/*
|--------------------------------------------------------------------------
| Image Filters
|--------------------------------------------------------------------------
|
| The list of filters you can use when making an image or generating an url.
| There is some built-in filters, and you can add or replace any. It is also
| possible to declare a filter with an array or a closure instead of a Filter
| Class.
|
*/
'filters' => [
'blur' => \Folklore\Image\Filters\Blur::class,
'colorize' => \Folklore\Image\Filters\Colorize::class,
'gamma' => \Folklore\Image\Filters\Gamma::class,
'grayscale' => \Folklore\Image\Filters\Grayscale::class,
'interlace' => \Folklore\Image\Filters\Interlace::class,
'negative' => \Folklore\Image\Filters\Negative::class,
'rotate' => \Folklore\Image\Filters\Rotate::class,
'resize' => \Folklore\Image\Filters\Resize::class
],
/*
|--------------------------------------------------------------------------
| Default Source
|--------------------------------------------------------------------------
|
| This option define the default source to be used by the Image facade. The
| source determine where the image files are read and saved.
|
*/
'source' => 'public',
/*
|--------------------------------------------------------------------------
| Sources
|--------------------------------------------------------------------------
|
| The list of sources where you store images.
|
| Supported driver: "local", "filesystem"
|
*/
'sources' => [
'public' => [
// The local driver use a local path on the machine.
'driver' => 'local',
// The path where the images are stored.
'path' => public_path()
],
'cloud' => [
// The filesystem driver lets you use the filesystem from laravel.
'driver' => 'filesystem',
// The filesystem disk where the images are stored.
'disk' => 'public',
// The path on the disk where the images are stored. If set to null,
// it will start from the root.
'path' => null,
// Cache the file on local machine. It can be useful for remote files.
'cache' => true,
// The path where you want to put cached files
'cache_path' => storage_path('image/cache')
]
],
/*
|--------------------------------------------------------------------------
| URL Generator
|--------------------------------------------------------------------------
|
| The URL Generator configuration is used when generating an image url
| and by the router to generate a pattern for catching image requests.
| These are the defaults values and you can overide it in each routes or
| when generating an url using the `pattern` parameter.
|
*/
'url' => [
// The format of the url that will be generated. The `{filters}` placeholder
// will be replaced by the filters according to the `filters_format`.
'format' => '{dirname}/{basename}{filters}.{extension}',
// The format of the filters that will replace `{filters}` in the
// url `format` above. The `{filter}` placeholder will be replaced by
// each filter according to the `filter_format` and joined
// by the `filter_separator`.
'filters_format' => '-filters({filter})',
// The format of a filter.
'filter_format' => '{key}({value})',
// The separator for each filter
'filter_separator' => '-',
// This is the regex that will replace any placeholders in the option 'format'.
// They are used when the route pattern is generated and added to the
// Laravel Router to match image request.
'placeholders_patterns' => [
'host' => '(.*?)?',
'dirname' => '(.*?)?',
'basename' => '([^\/\.]+?)',
'filename' => '([^\/]+)',
'extension' => '(jpeg|jpg|gif|png)',
]
],
/*
|--------------------------------------------------------------------------
| Routes
|--------------------------------------------------------------------------
|
| Default configuration for image routes. See routes/image.php
|
*/
'routes' => [
// Path to the routes file that will be automatically loaded. Set to null
// to prevent auto-loading of routes.
'map' => base_path('routes/images.php'),
// Default domain for routes
'domain' => null,
// Default namespace for controller
'namespace' => null,
// Default middlewares for routes
'middleware' => [],
// The controller serving the images
'controller' => '\Folklore\Image\Http\ImageController@serve',
// The name of the pattern that will be added to the Laravel Router.
'pattern_name' => 'image_pattern',
// The middleware used when a route as `cache` enabled
'cache_middleware' => 'image.middleware.cache'
],
/*
|--------------------------------------------------------------------------
| Image Driver
|--------------------------------------------------------------------------
|
| This option controls the default image "driver" used by Imagine library
| to manipulate images.
|
| Supported: "gd", "imagick", "gmagick"
|
*/
'driver' => 'gd',
/*
|--------------------------------------------------------------------------
| Memory limit
|--------------------------------------------------------------------------
|
| When manipulating an image, the memory limit is increased to this value
|
*/
'memory_limit' => '128M',
];