public async Task <IActionResult> CropServerImage( string sourceFilePath, int x1, int y1, int widthToCrop, int heightToCrop, int finalWidth, int finalHeight ) { //var widthToCrop = x2 - x1; //var heightToCrop = y2 - y1; var result = await _fileManagerService.CropFile( _autoUploadOptions, sourceFilePath, x1, y1, widthToCrop, heightToCrop, finalWidth, finalHeight ); return(Json(result)); }
public async Task <IActionResult> CropServerImage( string sourceFilePath, int x1, int y1, int widthToCrop, int heightToCrop, int finalWidth, int finalHeight ) { //var widthToCrop = x2 - x1; //var heightToCrop = y2 - y1; var result = await _fileManagerService.CropFile( _autoUploadOptions, sourceFilePath, x1, y1, widthToCrop, heightToCrop, finalWidth, finalHeight ); var list = new List <UploadResult>() { result }; foreach (var handler in _uploadHandlers) { try { await handler.Handle(list); } catch (Exception ex) { _log.LogError($"{ex.Message}-{ex.StackTrace}"); } } return(Json(result)); }