Laravel-filemanager: Resize ( Width or height needs to be defined )

Created on 16 May 2017  路  10Comments  路  Source: UniSharp/laravel-filemanager

InvalidArgumentException in Size.php line 107:
Width or height needs to be defined.
in Size.php line 107
at Size->resize(null, null, null) in ResizeCommand.php line 20
at ResizeCommand->execute(object(Image)) in AbstractDriver.php line 92
at AbstractDriver->executeCommand(object(Image), 'resize', array(null, null)) in Image.php line 106
at Image->__call('resize', array(null, null)) in ResizeController.php line 65
at ResizeController->performResize()
at call_user_func_array(array(object(ResizeController), 'performResize'), array()) in Controller.php line 55
at Controller->callAction('performResize', array()) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(ResizeController), 'performResize') in Route.php line 203

Laravel 5.4
Unisharp filemanager 1.7.6
XAMPP for windows

I already add route :

Route::get('/laravel-filemanager/crop', '\Unisharp\Laravelfilemanager\controllers\CropController@getCrop');
Route::get('/laravel-filemanager/cropimage', '\Unisharp\Laravelfilemanager\controllers\CropController@getCropimage');

but still it wont crop and said width and height null

WIP

Most helpful comment

This is a v1.8.1 issue, and is fixed in dev-master. We will release v1.8.2 to fix this soon.

All 10 comments

Same issue here. Not working if user only loads img and clicks "resize" button without actually resizing the img.

@rebornishard have You tried to resize the img by pulling the edges? It should work, the dimensions are posted to Size.php

sorry for my english.

@dct24 it actualy resizing, but when submit all error come out because of this

Width or height needs to be defined.
in Size.php line 107

my english also bad

Issue is still actual. It happens only if i click on resize button without resizing image.

{ "message": "Width or height needs to be defined.", "exception": "Intervention\Image\Exception\InvalidArgumentException", "file": "/home/vagrant/code/vendor/intervention/image/src/Intervention/Image/Size.php", "line": 107, "trace": [ { "file": "/home/vagrant/code/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResizeCommand.php", "line": 20, "function": "resize", "class": "Intervention\Image\Size", "type": "->" }, { "file": "/home/vagrant/code/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php", "line": 92, "function": "execute", "class": "Intervention\Image\Gd\Commands\ResizeCommand", "type": "->" }, { "file": "/home/vagrant/code/vendor/intervention/image/src/Intervention/Image/Image.php", "line": 106, "function": "executeCommand", "class": "Intervention\Image\AbstractDriver", "type": "->" }, { "file": "/home/vagrant/code/vendor/unisharp/laravel-filemanager/src/controllers/ResizeController.php", "line": 66, "function": "__call", "class": "Intervention\Image\Image", "type": "->" }, { "function": "performResize", "class": "Unisharp\Laravelfilemanager\controllers\ResizeController", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Controller.php", "line": 54, "function": "call_user_func_array" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php", "line": 45, "function": "callAction", "class": "Illuminate\Routing\Controller", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 212, "function": "dispatch", "class": "Illuminate\Routing\ControllerDispatcher", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 169, "function": "runController", "class": "Illuminate\Routing\Route", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 625, "function": "run", "class": "Illuminate\Routing\Route", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 30, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Router", "type": "->" }, { "file": "/home/vagrant/code/vendor/unisharp/laravel-filemanager/src/middlewares/CreateDefaultFolder.php", "line": 17, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Unisharp\Laravelfilemanager\middlewares\CreateDefaultFolder", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/unisharp/laravel-filemanager/src/middlewares/MultiUser.php", "line": 25, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Unisharp\Laravelfilemanager\middlewares\MultiUser", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php", "line": 41, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Routing\Middleware\SubstituteBindings", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php", "line": 43, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Auth\Middleware\Authenticate", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php", "line": 67, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Foundation\Http\Middleware\VerifyCsrfToken", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php", "line": 49, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\View\Middleware\ShareErrorsFromSession", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php", "line": 63, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Session\Middleware\StartSession", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php", "line": 37, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php", "line": 59, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Cookie\Middleware\EncryptCookies", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 102, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 627, "function": "then", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 586, "function": "runRouteWithinStack", "class": "Illuminate\Routing\Router", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 564, "function": "dispatchToRoute", "class": "Illuminate\Routing\Router", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 176, "function": "dispatch", "class": "Illuminate\Routing\Router", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 30, "function": "Illuminate\Foundation\Http\{closure}", "class": "Illuminate\Foundation\Http\Kernel", "type": "->" }, { "file": "/home/vagrant/code/vendor/fideloper/proxy/src/TrustProxies.php", "line": 56, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Fideloper\Proxy\TrustProxies", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 30, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Foundation\Http\Middleware\TransformsRequest", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 30, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Foundation\Http\Middleware\TransformsRequest", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php", "line": 27, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Foundation\Http\Middleware\ValidatePostSize", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php", "line": 46, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 149, "function": "handle", "class": "Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\Pipeline\{closure}", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 102, "function": "Illuminate\Routing\{closure}", "class": "Illuminate\Routing\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 151, "function": "then", "class": "Illuminate\Pipeline\Pipeline", "type": "->" }, { "file": "/home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 116, "function": "sendRequestThroughRouter", "class": "Illuminate\Foundation\Http\Kernel", "type": "->" }, { "file": "/home/vagrant/code/public/index.php", "line": 55, "function": "handle", "class": "Illuminate\Foundation\Http\Kernel", "type": "->" } ] }

please fix

Thank you guys for reporting this issue.

I'm not able to reproduce the issue.
In my browser, it will always have a default size and doesn't occur any errors.

Would you please also paste your browser console error here?

This is a v1.8.1 issue, and is fixed in dev-master. We will release v1.8.2 to fix this soon.

@g0110280 thanks sir 馃憤

A fixed issue should be closed. (and links its commit)

@g0110280 what commit is it?

Perhaps aee7411 from #379

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fahadhowlader picture fahadhowlader  路  5Comments

DaxtonChen picture DaxtonChen  路  4Comments

farshidahmadianpin picture farshidahmadianpin  路  3Comments

lunadiotic picture lunadiotic  路  3Comments

lukaszevo picture lukaszevo  路  4Comments