Skip to content

Commit 818df9b

Browse files
committed
Added ByteSize
1 parent 6da9978 commit 818df9b

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/ImageWizard.Core/ImageWizard.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="AsyncKeyLock" Version="1.0.6" />
24+
<PackageReference Include="DataUnits" Version="1.0.2" />
2425
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
2526
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
2627
</ItemGroup>

src/ImageWizard.Core/Loaders/LoaderOptions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// https://github.com/usercode/ImageWizard
33
// MIT License
44

5+
using DataUnits;
6+
57
namespace ImageWizard.Loaders;
68

79
/// <summary>
@@ -22,5 +24,5 @@ public class LoaderOptions
2224
/// <summary>
2325
/// Maximum loader source content length (Default: 32 MB)
2426
/// </summary>
25-
public long MaxLoaderSourceLength { get; set; } = 1024 * 1024 * 32; //25 MB
27+
public ByteSize MaxLoaderSourceLength { get; set; } = ByteSize.FromMegabytes(32);
2628
}

src/ImageWizard.TestApp/appsettings.Development.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"FileLoader": {
1313
"Folder": "wwwroot"
1414
},
15+
"HttpLoader": {
16+
"MaxLoaderSourceLength" : "10 MB"
17+
},
1518
"Watermark": {
1619
"Margin": 20,
1720
"Image": "wwwroot/img/copyright.png",

0 commit comments

Comments
 (0)