Skip to content

Commit e38bc79

Browse files
Merge pull request #384 from SixLabors/js/update-refs
Update ImageSharp, dispose asynchronously
2 parents a9753c7 + 8a0ed06 commit e38bc79

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/ImageSharp.Web/ImageCacheMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public async Task WriteAsync(Stream stream)
199199
{
200200
Dictionary<string, string> dictionary = this.ToDictionary();
201201

202-
using StreamWriter writer = new(stream, Encoding.UTF8);
202+
await using StreamWriter writer = new(stream, Encoding.UTF8);
203203
foreach (KeyValuePair<string, string> keyValuePair in dictionary)
204204
{
205205
// TODO: string.Create

src/ImageSharp.Web/ImageSharp.Web.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<AssemblyTitle>SixLabors.ImageSharp.Web</AssemblyTitle>
@@ -46,7 +46,7 @@
4646
<ItemGroup>
4747
<FrameworkReference Include="Microsoft.AspNetCore.App" />
4848
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
49-
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.7" />
49+
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.8" />
5050
</ItemGroup>
5151

5252
<Import Project="..\..\shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems" Label="Shared" />

src/ImageSharp.Web/Middleware/ImageSharpMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ private async Task ProcessRequestAsync(
342342
maxAge = sourceImageMetadata.CacheControlMaxAge;
343343
}
344344

345-
using (Stream inStream = await sourceImageResolver.OpenReadAsync())
345+
await using (Stream inStream = await sourceImageResolver.OpenReadAsync())
346346
{
347347
// TODO: Do we need some way to set options based upon processors?
348348
DecoderOptions decoderOptions = await this.options.OnBeforeLoadAsync.Invoke(imageCommandContext, this.options.Configuration)
@@ -524,7 +524,7 @@ private async Task SendResponseAsync(
524524
{
525525
Guard.NotNull(cacheResolver);
526526

527-
using Stream cacheStream = await cacheResolver.OpenReadAsync();
527+
await using Stream cacheStream = await cacheResolver.OpenReadAsync();
528528
await imageContext.SendAsync(cacheStream, metadata);
529529
}
530530
catch (Exception ex)

0 commit comments

Comments
 (0)