@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $this->getName($width, $height) . '.' . $pic->getClientOriginalExtension(), self::EXTENSION_DOT_LENGTH); |
26 | 26 | Storage::put('compressed/' . $newName, File::get($pic)); |
27 | 27 | $img = Image::make(storage_path('app/compressed/') . $newName); |
28 | - $resize = $img->resize($width, $height, function ($constraint) { |
|
28 | + $resize = $img->resize($width, $height, function($constraint) { |
|
29 | 29 | $constraint->aspectRatio(); |
30 | 30 | $constraint->upsize(); |
31 | 31 | }); |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | return $img->response(); |
36 | 36 | } |
37 | 37 | } catch (\Exception $e) { |
38 | - return response()->json(['bad_input' => 'The input image is corrupted'], 204); |
|
38 | + return response()->json([ 'bad_input' => 'The input image is corrupted' ], 204); |
|
39 | 39 | } |
40 | - return response()->json(['bad_input' => 'The input image is corrupted'], 204); |
|
40 | + return response()->json([ 'bad_input' => 'The input image is corrupted' ], 204); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | public function resizeremote(Request $request, ImageOptimizer $imageOptimizer) |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | ]); |
53 | 53 | $imageOptimizer->optimizeImage($file); |
54 | 54 | $img = Image::make($file); |
55 | - $resize = $img->resize($width, $height, function ($constraint) { |
|
55 | + $resize = $img->resize($width, $height, function($constraint) { |
|
56 | 56 | $constraint->aspectRatio(); |
57 | 57 | $constraint->upsize(); |
58 | 58 | }); |
59 | 59 | if ($resize) { |
60 | 60 | return $img->response(); |
61 | 61 | } |
62 | - return response()->json(['bad_input' => 'The input image is corrupted']); |
|
62 | + return response()->json([ 'bad_input' => 'The input image is corrupted' ]); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | private function getName($w, $h) |