Example #1
0
        public virtual async Task <CachedImage> GetAsync(int?mediaFileId, MediaPathData pathData, ProcessImageQuery query = null)
        {
            Guard.NotNull(pathData, nameof(pathData));

            var resultExtension = query?.GetResultExtension();

            if (resultExtension != null)
            {
                pathData.Extension = resultExtension;
            }

            var imagePath = GetCachedImagePath(mediaFileId, pathData, query);
            var file      = await _fileSystem.GetFileAsync(BuildPath(imagePath));

            var result = new CachedImage(file)
            {
                Path      = imagePath,
                Extension = pathData.Extension,
                IsRemote  = _fileSystem.StorageConfiguration.IsCloudStorage
            };

            return(result);
        }
Example #2
0
 private async Task PostPut(CachedImage cachedImage, string path)
 {
     cachedImage.Exists = true;
     cachedImage.File   = await _fileSystem.GetFileAsync(path);
 }