Skip to content

Commit c1cf049

Browse files
Add WebRootImageProvider
1 parent f7c5dae commit c1cf049

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Six Labors.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
using Microsoft.AspNetCore.Hosting;
5+
6+
namespace SixLabors.ImageSharp.Web.Providers
7+
{
8+
/// <summary>
9+
/// Returns images from the web root file provider.
10+
/// </summary>
11+
public sealed class WebRootImageProvider : FileProviderImageProvider
12+
{
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="WebRootImageProvider"/> class.
15+
/// </summary>
16+
/// <param name="environment">The web hosting environment.</param>
17+
/// <param name="formatUtilities">Contains various format helper methods based on the current configuration.</param>
18+
public WebRootImageProvider(
19+
#if NETCOREAPP2_1
20+
IHostingEnvironment environment,
21+
#else
22+
IWebHostEnvironment environment,
23+
#endif
24+
FormatUtilities formatUtilities)
25+
: base(environment.WebRootFileProvider, formatUtilities)
26+
{
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)