Skip to content

Commit fdb3ed5

Browse files
committed
fix crop image bug
1 parent f51c848 commit fdb3ed5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/controllers/CropController.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ class CropController extends LfmController {
2020
public function getCrop()
2121
{
2222
$working_dir = Input::get('working_dir');
23-
$image = Input::get('img');
23+
$img = parent::getUrl() . Input::get('img');
2424

2525
return View::make('laravel-filemanager::crop')
26-
->with('img', parent::getUrl() . $image)
27-
->with('working_dir', $working_dir)
28-
->with('image', $image);
26+
->with(compact('working_dir', 'img'));
2927
}
3028

3129

@@ -41,8 +39,8 @@ public function getCropimage()
4139
$dataWidth = Input::get('dataWidth');
4240

4341
// crop image
44-
$image = Image::make(public_path() . $image);
45-
$image->crop($dataWidth, $dataHeight, $dataX, $dataY)
42+
$tmp_img = Image::make(public_path() . $image);
43+
$tmp_img->crop($dataWidth, $dataHeight, $dataX, $dataY)
4644
->save(public_path() . $image);
4745

4846
// make new thumbnail

0 commit comments

Comments
 (0)