Chronostasys / Blazor.Cropper

A blazor library provides component to crop image
MIT License
82 stars 20 forks source link

render-mode="Server" fails when when loading an image. #33

Closed accessguru closed 2 years ago

accessguru commented 2 years ago

I created a simple razor component with your sample. I'm using server side blazor. The page renders, but when you click "choose file", the console reports the following error.

blazor.server.js:1 Uncaught (in promise) Error: System.NullReferenceException: Object reference not set to an instance of an object. at Blazor.Cropper.Cropper.get_WiderThanContainer() at Blazor.Cropper.Cropper.GetI() at Blazor.Cropper.Cropper.SizeChanged() at Blazor.Cropper.Cropper.OnSizeChangeEnd(MouseEventArgs args) at Blazor.Cropper.Cropper.b__134_2(MouseEventArgs args) at Blazor.Cropper.Cropper.MouseUpCaller(MouseEventArgs args) --- End of stack trace from previous location --- at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously(JSRuntime jsRuntime, DotNetInvocationInfo& callInfo, IDotNetObjectReference objectReference, String argsJson) at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson) at Object.endInvokeDotNetFromJS (http://localhost/ImpactWeb/_framework/blazor.server.js:1:70618) at e. (http://localhost/ImpactWeb/_framework/blazor.server.js:10:48412) at http://localhost/ImpactWeb/_framework/blazor.server.js:1:26442 at Array.forEach () at e.invokeClientMethod (http://localhost/ImpactWeb/_framework/blazor.server.js:1:26412) at e.processIncomingData (http://localhost/ImpactWeb/_framework/blazor.server.js:1:24223) at e.connection.onreceive (http://localhost/ImpactWeb/_framework/blazor.server.js:1:17308) at e. (http://localhost/ImpactWeb/_framework/blazor.server.js:1:38200) at http://localhost/ImpactWeb/_framework/blazor.server.js:1:35167 at Object.next (http://localhost/ImpactWeb/_framework/blazor.server.js:1:35272)

Chronostasys commented 2 years ago

Hi accessguru.
Thanks for reporting this issue. Did you set PureCSharpProcessing="true"? The cropper only works on serverside when this option was set.

accessguru commented 2 years ago

Yes I did set that property to true. Thanks for the quick response!

Lawrence Mantin (405) 887-1869

On Nov 6, 2021, at 7:19 AM, Boxiu Lee @.***> wrote:

 Hi accessguru. Thanks for reporting this issue. Did you set PureCSharpProcessing="true"? The cropper only works on serverside when this option was set.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Chronostasys commented 2 years ago

I failed to reproduce this issue on my pc. Here's my test code https://github.com/Chronostasys/ServerSideCropperExample.
Could you provide me a minimum project to reproduce the issue?

accessguru commented 2 years ago

I'll try it on Monday and let you know. Thanks again for your quick response.

Lawrence Mantin (405) 887-1869

On Nov 6, 2021, at 9:52 AM, Boxiu Lee @.***> wrote:

 I failed to reproduce this issue on my pc. Here's my test code https://github.com/Chronostasys/ServerSideCropperExample. Could you provide me a minimum project to reproduce the issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

accessguru commented 2 years ago

I appreciate you sharing this with me. You’re code is fine, just a stupid oversight on my end.

Have a great week!

From: Boxiu Lee @.> Sent: Saturday, November 6, 2021 9:52 AM To: Chronostasys/Blazor.Cropper @.> Cc: Lawrence Mantin @.>; Author @.> Subject: Re: [Chronostasys/Blazor.Cropper] render-mode="Server" fails when when loading an image. (Issue #33)

I failed to reproduce this issue on my pc. Here's my test code https://github.com/Chronostasys/ServerSideCropperExample. Could you provide me a minimum project to reproduce the issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Chronostasys/Blazor.Cropper/issues/33#issuecomment-962462738 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZKELGZSJTVUEL7JDYUQEDUKU6JFANCNFSM5HMGZX2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/ABZKELC2QQMJKVVCSRQUPBDUKU6JFA5CNFSM5HMGZX2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHFPAIEQ.gif

Chronostasys commented 2 years ago

Great to hear that!