File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ vendor /
Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ public function index($limit) {
7979 $ _files = [];
8080 foreach ($ exec as $ i => $ item ) {
8181 if (!is_dir ($ this ->directory . '/ ' . $ item )) {
82+ $ this ->_resize ($ item );
83+
8284 $ _files [$ i ]['fullname ' ] = $ item ;
8385 $ _files [$ i ]['name ' ] = pathinfo ($ item , PATHINFO_FILENAME );
8486 $ _files [$ i ]['url ' ] = $ this ->url ($ this ->directory_name . '/ ' . $ item );
@@ -168,9 +170,14 @@ public function _resize($fileName) {
168170 if (!is_dir ($ this ->directory . '/ ' . $ thumb_folder ))
169171 mkdir ($ this ->directory . '/ ' . $ thumb_folder );
170172
171- $ image = Image::make ($ this ->directory . '/ ' . $ fileName );
173+ $ file = $ this ->directory . '/ ' . $ fileName ;
174+ $ thumb_file = $ this ->directory . '/ ' . $ thumb_folder . '/ ' . $ fileName ;
175+
176+ if (file_exists ($ thumb_file )) continue ;
177+
178+ $ image = Image::make ($ file );
172179 $ image ->fit ($ thumb );
173- $ image ->save ($ this -> directory . ' / ' . $ thumb_folder . ' / ' . $ fileName );
180+ $ image ->save ($ thumb_file );
174181 }
175182 }
176183
You can’t perform that action at this time.
0 commit comments