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.
------------
//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()
------------