Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cropper - use alternative image sources other than a directory #5829

Closed
drma-tech opened this issue Nov 10, 2024 · 7 comments
Closed

Cropper - use alternative image sources other than a directory #5829

drma-tech opened this issue Nov 10, 2024 · 7 comments
Labels
Type: Feature ⚙ Request or idea for a new feature.

Comments

@drma-tech
Copy link

In the Image and FigureImage components I can use an image source like this:

www.site.com/image.png
or
$"data:{file.Type};base64,{Convert.ToBase64String(buffer)}"

but in the cropper, if I try to use an image that is not a directory (at least that's what I think is happening), the following error occurs:

invoke-js.ts:176 fail: Microsoft.AspNetCore.Components.Web.ErrorBoundary[0]
      System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
       ---> System.NullReferenceException: Object reference not set to an instance of an object.
         at Blazorise.Cropper.Cropper.<>c__DisplayClass1_0.<<SetParametersAsync>b__0>d.MoveNext()
      --- End of stack trace from previous location ---
         at Blazorise.BaseAfterRenderComponent.OnAfterRenderAsync(Boolean firstRender)
         at Blazorise.BaseComponent.OnAfterRenderAsync(Boolean firstRender)
         at Blazorise.Cropper.Cropper.OnAfterRenderAsync(Boolean firstRender)
         --- End of inner exception stack trace ---
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Blazorise.Cropper.Cropper.<>c__DisplayClass1_0.<<SetParametersAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Blazorise.BaseAfterRenderComponent.OnAfterRenderAsync(Boolean firstRender)
   at Blazorise.BaseComponent.OnAfterRenderAsync(Boolean firstRender)
   at Blazorise.Cropper.Cropper.OnAfterRenderAsync(Boolean firstRender)
   --- End of inner exception stack trace ---
@drma-tech drma-tech added the Type: Feature ⚙ Request or idea for a new feature. label Nov 10, 2024
@tesar-tech
Copy link
Collaborator

Do you find this related #5809? It has been fixed for 1.7 that will be out soon.

I can confirm you can work with base64 images.

@drma-tech
Copy link
Author

is it possible. as soon as possible i will test.

@drma-tech
Copy link
Author

It seems that the version that is in the nuget is from 3 weeks ago, before this correction.

@tesar-tech
Copy link
Collaborator

It seems that the version that is in the nuget is from 3 weeks ago, before this correction.

That's correct. 1.7 is not released yet.

@drma-tech
Copy link
Author

i was talking about preview version (1.7.0-preview1)

@stsrki
Copy link
Collaborator

stsrki commented Nov 11, 2024

@drma-tech
Copy link
Author

ok, its working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature ⚙ Request or idea for a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants