Skip to content

Commit 9c9eefc

Browse files
MaxymGornColdForeigndependabot[bot]
authored
Release 1.4.1 (#410)
## Target <!-- Why are you making this change? --> Release 1.4.1 #### Open Questions <!-- OPTIONAL - [ ] Use the GitHub checklists to spark discussion on issues that may arise from your approach. Please tick the box and explain your answer. --> ## Checklist <!-- It serves as a gentle reminder for common tasks. Confirm it's done and check everything that applies. --> - [ ] Tests cover new or modified code - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the site documentation - [ ] I have made corresponding changes to the README, NuGet README file - [ ] My changes generate no new warnings - [ ] New dependencies added or updated - [ ] Includes breaking changes - [ ] Version bumped ## Visuals <!-- OPTIONAL Show results both before and after this change. When the output changes, it can be a screenshot of a trace, metric, or log illustrating the change. --> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: ColdForeign <tankon46555@gmail.com> Co-authored-by: George Radchuk <38187349+ColdForeign@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 3a22cc7 commit 9c9eefc

File tree

87 files changed

+3646
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+3646
-92
lines changed

.github/workflows/cd.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,7 @@ jobs:
198198
- name: DotNet Build Blazor MAUI Demo Project for .net 8
199199
run: dotnet build --no-restore
200200
working-directory: examples\Cropper.Blazor.MAUI.Net8
201+
202+
- name: DotNet Build Blazor Server Demo Project for .net 9
203+
run: dotnet build --no-restore
204+
working-directory: examples\Cropper.Blazor.Server.Net9

examples/Cropper.Blazor.Demo.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MVC", "MVC", "{C1872578-F52
3131
EndProject
3232
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{FE00A07D-B8ED-4AC5-81A7-9F0AF7AE949B}"
3333
EndProject
34+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cropper.Blazor.Server.Net9", "Cropper.Blazor.Server.Net9\Cropper.Blazor.Server.Net9.csproj", "{AB066CDE-E4BA-4093-8EEF-64E0794EB9A4}"
35+
EndProject
3436
Global
3537
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3638
Debug|Any CPU = Debug|Any CPU
@@ -71,6 +73,10 @@ Global
7173
{BDE3364F-64EA-4906-A889-63CC4BD6EF25}.Debug|Any CPU.Build.0 = Debug|Any CPU
7274
{BDE3364F-64EA-4906-A889-63CC4BD6EF25}.Release|Any CPU.ActiveCfg = Release|Any CPU
7375
{BDE3364F-64EA-4906-A889-63CC4BD6EF25}.Release|Any CPU.Build.0 = Release|Any CPU
76+
{AB066CDE-E4BA-4093-8EEF-64E0794EB9A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
77+
{AB066CDE-E4BA-4093-8EEF-64E0794EB9A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
78+
{AB066CDE-E4BA-4093-8EEF-64E0794EB9A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
79+
{AB066CDE-E4BA-4093-8EEF-64E0794EB9A4}.Release|Any CPU.Build.0 = Release|Any CPU
7480
EndGlobalSection
7581
GlobalSection(SolutionProperties) = preSolution
7682
HideSolutionNode = FALSE
@@ -88,6 +94,7 @@ Global
8894
{4DED931E-A01B-4B5F-AA64-A003FC0F8DC1} = {49B4C364-A66D-44E3-8094-35C8CEC06100}
8995
{C1872578-F52C-42A9-98E1-7057E54705E6} = {49B4C364-A66D-44E3-8094-35C8CEC06100}
9096
{FE00A07D-B8ED-4AC5-81A7-9F0AF7AE949B} = {49B4C364-A66D-44E3-8094-35C8CEC06100}
97+
{AB066CDE-E4BA-4093-8EEF-64E0794EB9A4} = {FE00A07D-B8ED-4AC5-81A7-9F0AF7AE949B}
9198
EndGlobalSection
9299
GlobalSection(ExtensibilityGlobals) = postSolution
93100
SolutionGuid = {5FA0980D-10C3-4751-9432-DE20984B0A69}

examples/Cropper.Blazor.MAUI.Net8/Components/Pages/Home.razor.cs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Cropper.Blazor.Events.CropReadyEvent;
77
using Cropper.Blazor.Events.CropStartEvent;
88
using Cropper.Blazor.Events.ZoomEvent;
9+
using Cropper.Blazor.Exceptions;
910
using Cropper.Blazor.Models;
1011
using Microsoft.AspNetCore.Components;
1112
using Microsoft.AspNetCore.Components.Forms;
@@ -89,13 +90,30 @@ public void OnErrorLoadImageEvent(ErrorEventArgs errorEventArgs)
8990

9091
public async void GetCroppedCanvasDataURL(GetCroppedCanvasOptions getCroppedCanvasOptions)
9192
{
92-
string croppedCanvasDataURL = await cropperComponent!.GetCroppedCanvasDataURLAsync(getCroppedCanvasOptions);
93-
DialogParameters parameters = new()
93+
ImageReceiver imageReceiver = await cropperComponent!.GetCroppedCanvasDataInBackgroundAsync(
94+
getCroppedCanvasOptions);
95+
96+
InvokeAsync(async () =>
9497
{
95-
{ "Src", croppedCanvasDataURL }
96-
};
97-
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true, BackdropClick = false };
98-
_dialogService!.Show<Shared.CroppedCanvasDialog>("CroppedCanvasDialog", parameters, options);
98+
try
99+
{
100+
using MemoryStream croppedCanvasDataStream = await imageReceiver.GetImageChunkStreamAsync();
101+
byte[] croppedCanvasData = croppedCanvasDataStream.ToArray();
102+
103+
string croppedCanvasDataURL = "data:image/png;base64," + Convert.ToBase64String(croppedCanvasData);
104+
105+
DialogParameters parameters = new()
106+
{
107+
{ "Src", croppedCanvasDataURL }
108+
};
109+
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true, BackdropClick = true };
110+
_dialogService!.Show<Shared.CroppedCanvasDialog>("CroppedCanvasDialog", parameters, options);
111+
}
112+
catch (ImageProcessingException ex)
113+
{
114+
JSRuntime.InvokeVoidAsync("console.log", ex.ToString());
115+
}
116+
});
99117
}
100118

101119
public async Task InputFileChange(InputFileChangeEventArgs inputFileChangeEventArgs)

examples/Cropper.Blazor.MAUI.Net8/Cropper.Blazor.MAUI.Net8.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@
5858
</ItemGroup>
5959

6060
<ItemGroup>
61-
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
62-
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
63-
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.70" />
64-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
61+
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.100" />
62+
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.100" />
63+
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.100" />
64+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
6565
<PackageReference Include="MudBlazor" Version="7.4.0" />
6666
</ItemGroup>
6767

examples/Cropper.Blazor.Server.Net6/Pages/Index.razor.cs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Cropper.Blazor.Events.CropReadyEvent;
77
using Cropper.Blazor.Events.CropStartEvent;
88
using Cropper.Blazor.Events.ZoomEvent;
9+
using Cropper.Blazor.Exceptions;
910
using Cropper.Blazor.Models;
1011
using Microsoft.AspNetCore.Components;
1112
using Microsoft.AspNetCore.Components.Forms;
@@ -89,13 +90,31 @@ public void OnErrorLoadImageEvent(ErrorEventArgs errorEventArgs)
8990

9091
public async void GetCroppedCanvasDataURL(GetCroppedCanvasOptions getCroppedCanvasOptions)
9192
{
92-
string croppedCanvasDataURL = await cropperComponent!.GetCroppedCanvasDataURLAsync(getCroppedCanvasOptions);
93-
DialogParameters parameters = new()
93+
ImageReceiver imageReceiver = await cropperComponent!.GetCroppedCanvasDataInBackgroundAsync(
94+
getCroppedCanvasOptions,
95+
maximumReceiveChunkSize: 1024 * 128);
96+
97+
InvokeAsync(async () =>
9498
{
95-
{ "Src", croppedCanvasDataURL }
96-
};
97-
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true };
98-
_dialogService!.Show<Shared.CroppedCanvasDialog>("CroppedCanvasDialog", parameters, options);
99+
try
100+
{
101+
using MemoryStream croppedCanvasDataStream = await imageReceiver.GetImageChunkStreamAsync();
102+
byte[] croppedCanvasData = croppedCanvasDataStream.ToArray();
103+
104+
string croppedCanvasDataURL = "data:image/png;base64," + Convert.ToBase64String(croppedCanvasData);
105+
106+
DialogParameters parameters = new()
107+
{
108+
{ "Src", croppedCanvasDataURL }
109+
};
110+
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true };
111+
_dialogService!.Show<Shared.CroppedCanvasDialog>("CroppedCanvasDialog", parameters, options);
112+
}
113+
catch (ImageProcessingException ex)
114+
{
115+
JSRuntime.InvokeVoidAsync("console.log", ex.ToString());
116+
}
117+
});
99118
}
100119

101120
public async Task InputFileChange(InputFileChangeEventArgs inputFileChangeEventArgs)

examples/Cropper.Blazor.Server.Net6/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
options.HandshakeTimeout = TimeSpan.FromSeconds(15);
1515
options.KeepAliveInterval = TimeSpan.FromSeconds(15);
1616
options.MaximumParallelInvocationsPerClient = 1;
17-
options.MaximumReceiveMessageSize = 32 * 1024 * 100;
17+
options.MaximumReceiveMessageSize = 128 * 1024;
1818
options.StreamBufferCapacity = 10;
1919
});
2020
builder.Services.AddCropper();

examples/Cropper.Blazor.Server.Net7/Pages/Index.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<InputFile id="imageInput" OnChange="InputFileChange" accept="image/*" hidden multiple />
1111
<MudIconButton HtmlTag="label" Icon="@Icons.Material.Filled.PhotoCamera" for="imageInput" Title="Upload image file" />
1212
</MudTooltip>
13-
<MudTooltip Text="cropper.getCroppedCanvas({ maxWidth: 4096, maxHeight: 4096 })">
13+
<MudTooltip Text="cropper.getCroppedCanvas({ maxWidth: 16096, maxHeight: 16096 })">
1414
<MudButton Color="Color.Secondary" Variant="Variant.Filled"
15-
OnClick="@(()=>GetCroppedCanvasDataURL(new GetCroppedCanvasOptions(){ MaxHeight = 4096, MaxWidth = 4096}))">
15+
OnClick="@(()=>GetCroppedCanvasDataURL(new GetCroppedCanvasOptions(){ MaxHeight = 16096, MaxWidth = 16096}))">
1616
Get Cropped Canvas
1717
</MudButton>
1818
</MudTooltip>

examples/Cropper.Blazor.Server.Net7/Pages/Index.razor.cs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Cropper.Blazor.Events.CropReadyEvent;
77
using Cropper.Blazor.Events.CropStartEvent;
88
using Cropper.Blazor.Events.ZoomEvent;
9+
using Cropper.Blazor.Exceptions;
910
using Cropper.Blazor.Models;
1011
using Microsoft.AspNetCore.Components;
1112
using Microsoft.AspNetCore.Components.Forms;
@@ -89,13 +90,31 @@ public void OnErrorLoadImageEvent(ErrorEventArgs errorEventArgs)
8990

9091
public async void GetCroppedCanvasDataURL(GetCroppedCanvasOptions getCroppedCanvasOptions)
9192
{
92-
string croppedCanvasDataURL = await cropperComponent!.GetCroppedCanvasDataURLAsync(getCroppedCanvasOptions);
93-
DialogParameters parameters = new()
93+
ImageReceiver imageReceiver = await cropperComponent!.GetCroppedCanvasDataInBackgroundAsync(
94+
getCroppedCanvasOptions,
95+
maximumReceiveChunkSize: 1024 * 64);
96+
97+
InvokeAsync(async () =>
9498
{
95-
{ "Src", croppedCanvasDataURL }
96-
};
97-
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true };
98-
_dialogService!.Show<Shared.CroppedCanvasDialog>("CroppedCanvasDialog", parameters, options);
99+
try
100+
{
101+
using MemoryStream croppedCanvasDataStream = await imageReceiver.GetImageChunkStreamAsync();
102+
byte[] croppedCanvasData = croppedCanvasDataStream.ToArray();
103+
104+
string croppedCanvasDataURL = "data:image/png;base64," + Convert.ToBase64String(croppedCanvasData);
105+
106+
DialogParameters parameters = new()
107+
{
108+
{ "Src", croppedCanvasDataURL }
109+
};
110+
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true };
111+
_dialogService!.Show<Shared.CroppedCanvasDialog>("CroppedCanvasDialog", parameters, options);
112+
}
113+
catch (ImageProcessingException ex)
114+
{
115+
JSRuntime.InvokeVoidAsync("console.log", ex.ToString());
116+
}
117+
});
99118
}
100119

101120
public async Task InputFileChange(InputFileChangeEventArgs inputFileChangeEventArgs)

examples/Cropper.Blazor.Server.Net7/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
options.HandshakeTimeout = TimeSpan.FromSeconds(15);
1515
options.KeepAliveInterval = TimeSpan.FromSeconds(15);
1616
options.MaximumParallelInvocationsPerClient = 1;
17-
options.MaximumReceiveMessageSize = 32 * 1024 * 100;
17+
options.MaximumReceiveMessageSize = 64 * 1024;
1818
options.StreamBufferCapacity = 10;
1919
});
2020
builder.Services.AddCropper();

examples/Cropper.Blazor.Server.Net8/Pages/Index.razor.cs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Cropper.Blazor.Events.CropReadyEvent;
77
using Cropper.Blazor.Events.CropStartEvent;
88
using Cropper.Blazor.Events.ZoomEvent;
9+
using Cropper.Blazor.Exceptions;
910
using Cropper.Blazor.Models;
1011
using Microsoft.AspNetCore.Components;
1112
using Microsoft.AspNetCore.Components.Forms;
@@ -89,13 +90,31 @@ public void OnErrorLoadImageEvent(ErrorEventArgs errorEventArgs)
8990

9091
public async void GetCroppedCanvasDataURL(GetCroppedCanvasOptions getCroppedCanvasOptions)
9192
{
92-
string croppedCanvasDataURL = await cropperComponent!.GetCroppedCanvasDataURLAsync(getCroppedCanvasOptions);
93-
DialogParameters parameters = new()
93+
ImageReceiver imageReceiver = await cropperComponent!.GetCroppedCanvasDataInBackgroundAsync(
94+
getCroppedCanvasOptions,
95+
maximumReceiveChunkSize: 1024 * 32);
96+
97+
InvokeAsync(async () =>
9498
{
95-
{ "Src", croppedCanvasDataURL }
96-
};
97-
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true, BackdropClick = false };
98-
_dialogService!.Show<Shared.CroppedCanvasDialog>("CroppedCanvasDialog", parameters, options);
99+
try
100+
{
101+
using MemoryStream croppedCanvasDataStream = await imageReceiver.GetImageChunkStreamAsync();
102+
byte[] croppedCanvasData = croppedCanvasDataStream.ToArray();
103+
104+
string croppedCanvasDataURL = "data:image/png;base64," + Convert.ToBase64String(croppedCanvasData);
105+
106+
DialogParameters parameters = new()
107+
{
108+
{ "Src", croppedCanvasDataURL }
109+
};
110+
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true, BackdropClick = true };
111+
_dialogService!.Show<Shared.CroppedCanvasDialog>("CroppedCanvasDialog", parameters, options);
112+
}
113+
catch (ImageProcessingException ex)
114+
{
115+
JSRuntime.InvokeVoidAsync("console.log", ex.ToString());
116+
}
117+
});
99118
}
100119

101120
public async Task InputFileChange(InputFileChangeEventArgs inputFileChangeEventArgs)

0 commit comments

Comments
 (0)