CropperBlazor / Cropper.Blazor

Cropper.js as Blazor component for cropping images
https://cropperblazor.github.io
MIT License
136 stars 14 forks source link

Installation guide flat out doesn't work. #219

Closed nhwilly closed 1 year ago

nhwilly commented 1 year ago

I've followed the installation instructions explicitly on an empty project. I get three copies of the image, no cropper and at least one variable reference that isn't found (which was easily corrected).

Is there an updated set of instructions someplace?

Why am I getting three images? I do not have Preview set in the options.

It looks like there a bunch of files in the sample project that aren't installed using the NuGet package.

Could that be it?

.NET 7, VS2022 Professional, Windows 11, Microsoft Edge.

MaxymGorn commented 1 year ago

Hi @nhwilly. If I understand correctly, you failed to initialize the cropper at all? If so, if you can provide more information about this case, it would be very helpful to have some sample code in razor and briefly in which vital methods (OnAfterRender/OnAfterRenderAsync, OnInitialized, etc) of the component we use the cropper component.

MaxymGorn commented 1 year ago

In addition, you can try to use installation guide cropper component with basic configuration in the demo site, I guess it can help you: https://cropperblazor.github.io/

nhwilly commented 1 year ago

So I decided to recreate an entire project from scratch just to demonstrate the problem I was having. Now, I'm not having it. Feeling a little stupid at the moment. There is a namespace problem with the Options line in the instructions, it should be:

 Options="new Cropper.Blazor.Models.Options()" />

But that wasn't the problem. I notice if you size the browser window things get a little wonky, but I'm going into a dialog box, so also not a problem.

Maybe I was trying to set too many options right at the outset instead of just doing the absolute minimum.

sigh

Sorry for the trouble. You can close this. Thanks.

MaxymGorn commented 1 year ago

@nhwilly Thanks for the feedback. I'm also considering making this option optional in the future, as it shouldn't block cropper creation