7
7
*/
8
8
9
9
/**
10
- * The directory where source images are found. This is generally where your
11
- * admin stores uploaded files. Can be either an absolute path to your local
12
- * disk (the default) or the name of an IoC binding of a Flysystem instance.
10
+ * The directory where source images are found. This is generally where your
11
+ * admin stores uploaded files. Can be either an absolute path to your local
12
+ * disk (the default) or the name of an IoC binding of a Flysystem instance.
13
13
*
14
14
* @var string Absolute path in local fileystem
15
15
* | string IoC binding name of League\Flysystem\Filesystem
16
16
* | string IoC binding name of League\Flysystem\Cached\CachedAdapter
17
17
*/
18
- 'src_dir ' => public_path () . '/uploads ' ,
18
+ 'src_dir ' => public_path (). '/uploads ' ,
19
19
20
20
/**
21
- * The directory where cropped images should be saved. The route to the
21
+ * The directory where cropped images should be saved. The route to the
22
22
* cropped versions is what should be rendered in your markup; it must be a
23
23
* web accessible directory.
24
24
*
25
25
* @var string Absolute path in local fileystem
26
26
* | string IoC binding name of League\Flysystem\Filesystem
27
27
* | string IoC binding name of League\Flysystem\Cached\CachedAdapter
28
28
*/
29
- 'crops_dir ' => public_path () . '/uploads ' ,
29
+ 'crops_dir ' => public_path (). '/uploads ' ,
30
30
31
31
/**
32
- * Maximum number of sizes to allow for a particular source file. This is to
33
- * limit scripts from filling up your hard drive with images. Set to falsey or
34
- * comment out to have no limit.
32
+ * Maximum number of sizes to allow for a particular source file. This is to
33
+ * limit scripts from filling up your hard drive with images. Set to false or
34
+ * comment out to have no limit. This is disabled by default because the
35
+ * `signing_key` is a better prevention of malicious usage.
35
36
*
36
37
* @var integer | boolean
37
38
*/
38
- 'max_crops ' => 12 ,
39
+ 'max_crops ' => false ,
39
40
40
41
41
42
/*
45
46
*/
46
47
47
48
/**
48
- * A regex pattern that compares against the Request path (`Request::path()`)
49
- * to find the image path to the image relative to the crops_dir. This path
50
- * will be used to find the source image in the src_dir. The path component of
51
- * the regex must exist in the first captured subpattern. In other words, in
52
- * the `preg_match` $matches[1].
49
+ * A regex pattern that is applied to both the src url passed to
50
+ * `Croppa::url()` as well as the crop path received when handling a crop
51
+ * request to find the path to the src image relative to both the src_dir
52
+ * and crops_dirs. This path will be used to find the source image in the
53
+ * src_dir. The path component of the regex must exist in the first captured
54
+ * subpattern. In other words, in the `preg_match` $matches[1].
53
55
*
54
56
* @var string
55
57
*/
56
58
'path ' => 'uploads/(.*)$ ' ,
57
59
58
60
/**
59
61
* A regex pattern that works like `path` except it is only used by the
60
- * `Croppa::url($url)` generator function. If the $path url matches, it is
61
- * passed through with no Croppa URL suffixes added. Thus, it will not be
62
- * cropped. This is designed, in particular, for animated gifs which lose
62
+ * `Croppa::url($url)` generator function. If the $path url matches, it is
63
+ * passed through with no Croppa URL suffixes added. Thus, it will not be
64
+ * cropped. This is designed, in particular, for animated gifs which lose
63
65
* animation when cropped.
64
66
*
65
67
* @var string
73
75
// 'url_prefix' => '//'.Request::getHttpHost().'/uploads/', // Local
74
76
// 'url_prefix' => 'https://your-bucket.s3.amazonaws.com/uploads/', // S3
75
77
78
+ /**
79
+ * Reject attempts to maliciously create images by signing the generated
80
+ * request with a hash based on the request parameters and this signing key.
81
+ * Set to 'app.key' to use Laravel's `app.key` config, any other string to use
82
+ * THAT as the key, or false to disable.
83
+ *
84
+ * If you are generating URLs outside of `Croppa::url()`, like the croppa.js
85
+ * module, you can disable this feature by setting the `signing_key` config
86
+ * to false.
87
+ *
88
+ * @var string|boolean
89
+ */
90
+ 'signing_key ' => 'app.key ' ,
91
+
92
+ /**
93
+ * The PHP memory limit used by the script to generate thumbnails. Some
94
+ * images require a lot of memory to perform the resize, so you may increase
95
+ * this memory limit.
96
+ */
97
+ 'memory_limit ' => '128M ' ,
76
98
77
99
/*
78
100
|-----------------------------------------------------------------------------
81
103
*/
82
104
83
105
/**
84
- * The jpeg quality of generated images. The difference between 100 and 95
85
- * usually cuts the file size in half. Going down to 70 looks ok on photos
106
+ * The jpeg quality of generated images. The difference between 100 and 95
107
+ * usually cuts the file size in half. Going down to 70 looks ok on photos
86
108
* and will reduce filesize by more than another half but on vector files
87
109
* there is noticeable aliasing.
88
110
*
91
113
'jpeg_quality ' => 95 ,
92
114
93
115
/**
94
- * Turn on interlacing to make progessive jpegs
116
+ * Turn on interlacing to make progessive jpegs.
95
117
*
96
118
* @var boolean
97
119
*/
98
120
'interlace ' => true ,
99
121
122
+ /**
123
+ * If the source image is smaller than the requested size, allow Croppa to
124
+ * scale up the image. This will reduce in quality loss.
125
+ *
126
+ * @var boolean
127
+ */
128
+ 'upscale ' => true ,
129
+
100
130
);
0 commit comments