Skip to content

Commit 115a365

Browse files
author
ChenCatherine
committed
Make thumb image width and height become optional. Make more comments for config.
1 parent 2f45c12 commit 115a365

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/config/lfm.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@
7575
'max_image_size' => 50000,
7676
'max_file_size' => 50000,
7777

78+
// If true, the uploading file's mime type will be valid in valid_image_mimetypes/valid_file_mimetypes.
7879
'should_validate_mime' => false,
80+
// If true, the uploading file's size will be verified for over than max_image_size/max_file_size.
7981
'should_validate_size' => false,
8082

8183
// available since v1.3.0
@@ -97,6 +99,16 @@
9799
'text/plain',
98100
],
99101

102+
/*
103+
|--------------------------------------------------------------------------
104+
| Image / Folder Setting
105+
|--------------------------------------------------------------------------
106+
*/
107+
108+
'thumb_img_width' => 200,
109+
'thumb_img_height' => 200,
110+
111+
100112
/*
101113
|--------------------------------------------------------------------------
102114
| File Extension Information

src/controllers/UploadController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private function makeThumb($new_filename)
138138

139139
// create thumb image
140140
Image::make(parent::getCurrentPath($new_filename))
141-
->fit(200, 200)
141+
->fit(config('thumb_img_width', 200), config('thumb_img_height', 200))
142142
->save(parent::getThumbPath($new_filename));
143143
}
144144

0 commit comments

Comments
 (0)