File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,21 @@ public function availableMimeTypes()
162162 {
163163 return $ this ->config ->get ('lfm.folder_categories. ' . $ this ->currentLfmType () . '.valid_mime ' );
164164 }
165+
166+ public function shouldCreateCategoryThumb ()
167+ {
168+ return $ this ->config ->get ('lfm.folder_categories. ' . $ this ->currentLfmType () . '.thumb ' );
169+ }
170+
171+ public function categoryThumbWidth ()
172+ {
173+ return $ this ->config ->get ('lfm.folder_categories. ' . $ this ->currentLfmType () . '.thumb_width ' );
174+ }
175+
176+ public function categoryThumbHeight ()
177+ {
178+ return $ this ->config ->get ('lfm.folder_categories. ' . $ this ->currentLfmType () . '.thumb_height ' );
179+ }
165180
166181 public function maxUploadSize ()
167182 {
Original file line number Diff line number Diff line change @@ -315,8 +315,10 @@ public function generateThumbnail($file_name)
315315
316316 // generate cropped image content
317317 $ this ->setName ($ file_name )->thumb (true );
318+ $ thumbWidth = $ this ->helper ->shouldCreateCategoryThumb () && $ this ->helper ->categoryThumbWidth () ? $ this ->helper ->categoryThumbWidth () : config ('lfm.thumb_img_width ' , 200 );
319+ $ thumbHeight = $ this ->helper ->shouldCreateCategoryThumb () && $ this ->helper ->categoryThumbHeight () ? $ this ->helper ->categoryThumbHeight () : config ('lfm.thumb_img_height ' , 200 );
318320 $ image = Image::make ($ original_image ->get ())
319- ->fit (config ( ' lfm.thumb_img_width ' , 200 ), config ( ' lfm.thumb_img_height ' , 200 ) );
321+ ->fit ($ thumbWidth , $ thumbHeight );
320322
321323 $ this ->storage ->put ($ image ->stream ()->detach (), 'public ' );
322324 }
Original file line number Diff line number Diff line change 5050 'folder_name ' => 'files ' ,
5151 'startup_view ' => 'list ' ,
5252 'max_size ' => 50000 , // size in KB
53+ 'thumb ' => true ,
54+ 'thumb_width ' => 80 ,
55+ 'thumb_height ' => 80 ,
5356 'valid_mime ' => [
5457 'image/jpeg ' ,
5558 'image/pjpeg ' ,
6366 'folder_name ' => 'photos ' ,
6467 'startup_view ' => 'grid ' ,
6568 'max_size ' => 50000 , // size in KB
69+ 'thumb ' => true ,
70+ 'thumb_width ' => 80 ,
71+ 'thumb_height ' => 80 ,
6672 'valid_mime ' => [
6773 'image/jpeg ' ,
6874 'image/pjpeg ' ,
You can’t perform that action at this time.
0 commit comments