/// <summary> /// /// </summary> public override void Dispose() { Close(); if (mStream != null) { mStream.DisposeAsync(); mStream = null; } }
private async Task ComputeOtherSizesAsync(Entry entry, Image image, Stream originalContent, bool canSeek) { if (!canSeek) { var memoryStream = new MemoryStream(); await originalContent.CopyToAsync(memoryStream); await originalContent.DisposeAsync(); originalContent = memoryStream; originalContent.Position = 0; canSeek = true; } using (var thumbnailContent = new MemoryStream()) using (var originalCopy = new MemoryStream()) { await originalContent.CopyToAsync(originalCopy); originalCopy.Position = 0; resizeService.Thumbnail(originalCopy, thumbnailContent, ThumbnailWidth, ThumbnailHeight); thumbnailContent.Position = 0; await fileStorage.SaveAsync(entry, image, thumbnailContent, ImageType.Thumbnail); } if (canSeek) { originalContent.Position = 0; } else { originalContent = await fileStorage.FindAsync(entry, image, ImageType.Original); } using (var previewContent = new MemoryStream()) using (var originalCopy = new MemoryStream()) { await originalContent.CopyToAsync(originalCopy); originalCopy.Position = 0; resizeService.Resize(originalCopy, previewContent, PreviewWidth); previewContent.Position = 0; await fileStorage.SaveAsync(entry, image, previewContent, ImageType.Preview); } }
public override ValueTask DisposeAsync() { return(_innerStream.DisposeAsync()); }
public override ValueTask DisposeAsync() => _innerStream.DisposeAsync();