Beispiel #1
0
        public async Task OnPostScaleImageAsync(Guid imageId, int imageSize, Guid?recordId)
        {
            RecordId = recordId;
            Image    = await _imagesService.FetchImageById(imageId);

            if (imageSize > 0 && imageSize <= Image.GetBiggestImageDimm())
            {
                await _imagesEditService.ReduceImageSize(imageId, imageSize);
            }
            await UpdateModel(imageId);
        }
Beispiel #2
0
        public async Task <IActionResult> ScaleDownImage(ScaleDownDto scaleDownDto)
        {
            try
            {
                await _imagesEditService.ReduceImageSize(scaleDownDto.ImageId, scaleDownDto.NewImageBiggestSide);

                return(Ok());
            }
            catch (ArgumentException exc)
            {
                return(BadRequest(exc.Message));
            }
        }