File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 22
33namespace UniSharp \LaravelFilemanager ;
44
5+ use Illuminate \Http \File ;
56use Illuminate \Container \Container ;
67use Intervention \Image \Facades \Image ;
78use Symfony \Component \HttpFoundation \File \UploadedFile ;
@@ -299,7 +300,7 @@ private function getNewName($file)
299300
300301 private function saveFile ($ file , $ new_file_name )
301302 {
302- $ this ->setName ($ new_file_name )->storage ->save (file_get_contents ( $ file) );
303+ $ this ->setName ($ new_file_name )->storage ->save ($ file );
303304
304305 $ this ->makeThumbnail ($ new_file_name );
305306
@@ -318,10 +319,13 @@ public function makeThumbnail($file_name)
318319 $ this ->setName (null )->thumb (true )->createFolder ();
319320
320321 // generate cropped image content
321- $ image_content = Image::make ($ original_image ->get ())
322+ $ image_path = $ this ->setName ($ file_name )->thumb (true )->path ('absolute ' );
323+ $ image = Image::make ($ original_image ->get ())
322324 ->fit (config ('lfm.thumb_img_width ' , 200 ), config ('lfm.thumb_img_height ' , 200 ))
323- ->encode ( );
325+ ->save ( $ image_path );
324326
325- $ this ->setName ($ file_name )->thumb (true )->storage ->save ((string ) $ image_content );
327+ $ file = new File ($ image_path );
328+
329+ $ this ->setName ($ file_name )->thumb (true )->storage ->save ($ file );
326330 }
327331}
You can’t perform that action at this time.
0 commit comments