예제 #1
0
        public async Task <BlobContent> ReadBlobContentAsync(long tenantId, long blobId)
        {
            Blob blob = await _storageRepository.ReadBlobAsync(tenantId, blobId);

            BlobContent blobContent = new BlobContent
            {
                Type   = blob.ContentType,
                Stream = await _blobService.ReadBlobContentAsync(blob)
            };

            return(blobContent);
        }
예제 #2
0
        public async Task <BlobContent> ReadBlobContentAsync(long tenantId, long blobId, string path)
        {
            Blob blob = await _storageRepository.ReadBlobAsync(tenantId, blobId);

            blob.Path = blob.Committed ? path : UncommittedPath;
            BlobContent blobContent = new BlobContent
            {
                Name   = blob.Name,
                Type   = blob.ContentType,
                Stream = await _blobService.ReadBlobContentAsync(blob)
            };

            return(blobContent);
        }
예제 #3
0
        public async Task <long> ResizeBlobAsync(long tenantId, long sourceBlobId, string path, ResizeOptions options)
        {
            Blob blob = await _storageRepository.ReadBlobAsync(tenantId, sourceBlobId);

            Stream imageStream = await _blobService.ReadBlobContentAsync(blob);

            blob.Path = path;
            Stream resizedImageStream = _imageAnalysisService.ResizeImage(imageStream, options);

            IBlobContent content = new BlobContent {
                Name = blob.Name, Type = blob.ContentType, Stream = resizedImageStream
            };

            return(await CreateBlobAsync(tenantId, content));
        }