/// <summary> /// Compress image and resize for mobile /// </summary> /// <param name="input"></param> public async Task <byte[]> CreateMobileSize(byte[] input) { var data = await Task.Factory.StartNew(() => { using (var resizer = new ImageResizer()) { return(resizer.Resize(input, 500, 500, quality: _quality)); } }); return(data); }
/// <summary> /// Compress image and resize /// </summary> /// <param name="input"></param> /// <param name="width"></param> /// <param name="height"></param> public async Task <byte[]> CreateNewSize(byte[] input, int width, int height) { var data = await Task.Factory.StartNew(() => { using (var resizer = new ImageResizer()) { return(resizer.Resize(input, width, height, _quality)); } }); return(data); }