# ImageTools.crop only gets width value

**URL:** https://forums.fusetools.com/t/imagetools-crop-only-gets-width-value/3006
**Category:** Bug Reports
**Created:** [March 21, 2017, 7:10pm UTC](https://forums.fusetools.com/t/imagetools-crop-only-gets-width-value/3006 "2017-03-21T19:10:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Wilton\_Augusto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/wilton_augusto/32/336_2.png) [@Wilton\_Augusto](https://forums.fusetools.com/u/Wilton_Augusto)
#### Post date: [March 21, 2017, 7:10pm UTC](https://forums.fusetools.com/t/imagetools-crop-only-gets-width-value/3006/1 "2017-03-21T19:10:34Z")

</div>

## Fuse version 0.34.0 (10613) OS: Windows 10

When I was cropping an image I only got squares even if the values from height and width were different.

So I tested some things

It dosent matter if the original image is in portrait or landscape ratio. I tested both.

```auto
------------
//original image
LOG: {"path":"IMG_20170321_154948.jpg","name":"IMG_20170321_153909.jpg","width":720,"height":1280,"info":{}}
------------
//new image with a height bigger than width
ImageTools.crop(image, {
				x : 0,
				y : 0,
				width : 100,
				height : 200,
				performInPlace : false
			});
------------
//new image
LOG: {"path":"IMG_20170321_153909.jpg","name":"IMG_20170321_153909.jpg","width":100,"height":100,"info":{}}
------------
//new image with a width bigger than height
ImageTools.crop(image, {
				x : 0,
				y : 0,
				width : 200,
				height : 100,
				performInPlace : false
			});
------------
//new image
LOG: {"path":"IMG_20170321_153909.jpg","name":"IMG_20170321_153909.jpg","width":200,"height":200,"info":{}}
------------
//if I remove height from the options the image is cropped without problems
ImageTools.crop(image, {
				x : 0,
				y : 0,
				width : 100,
				performInPlace : false
			});
------------
//new image
LOG: {"path":"IMG_20170321_153909.jpg","name":"IMG_20170321_153909.jpg","width":100,"height":100,"info":{}}
------------
//if I remove the width I get an error
ImageTools.crop(image, {
				x : 0,
				y : 0,
				height: 100,
				performInPlace : false
			});
------------
LOG: Uno.Exception: Width and height must be larger than 0
       at Fuse.ImageTools.ImageTools.CropImageInterface(object[])
       at Fuse.Scripting.NativePromise`2.ContextClosure.CreatePromise(object[])
       at Fuse.Scripting.V8.Marshaller.CallbackWrapper.Call(Fuse.Scripting.V8.Simple.JSValue[],Fuse.Scripting.V8.Simple.JSValue&)
       at Fuse.Scripting.V8.V8SimpleExtensions.Call(Fuse.Scripting.V8.Simple.JSFunction,Fuse.Scripting.V8.Simple.JSContext,Fuse.Scripting.V8.Simple.JSObject,Fuse.Scripting.V8.Simple.JSValue[],Fuse.Scripting.V8.AutoReleasePool,Uno.Action<Fuse.Scripting.V8.Simple.JSScriptException>)
       at Fuse.Scripting.V8.Function.Call(object[])
       at Fuse.Scripting.NativePromise`2.PromiseClosure.InternalResolve()
       at Fuse.Reactive.ThreadWorker.RunInner()
       at Fuse.Reactive.ThreadWorker.Run()
------------

```
