-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Blazor Image component to display images that are not accessible through HTTP endpoints #25274
Comments
Thanks for contacting us. |
Thanks for contacting us. |
This sounds like a really nice feature. |
We could consider this a special case of "support passing |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
This is a useful feature. But, the "support passing byte[]" in JS interop calls is a better generalization and more flexible approach. |
This would be benefitial to reduce the attack surface of web applications: no additional rest interface needed for image creation. We currently use base64 encoded images and it would be nice to reduce the memory overhead for this. |
Another instance of this #31585 |
In the interim a new docs page covering best practices for working with images in Blazor (in .NET 6) is available here: https://docs.microsoft.com/aspnet/core/blazor/images?view=aspnetcore-6.0 |
Thanks all for the discussion.
This is exactly the scenario https://docs.microsoft.com/aspnet/core/blazor/images?view=aspnetcore-6.0 covers. Closing out this issue accordingly. |
While we have made progress on this feature, at this point we think the risk is too high to include this in the .NET 7 release. Moving to .NET 8. |
Another instance this component is useful #47449 |
Another problematic case #48123 |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Summary
Introduce an Image component to display images coming from
dynamic
sources like API calls or databases.Motivation
Currently the most common way to display an image coming from the
Database
is to base64 encoded it and create an object URL for it. This is problematic since images have a big size and that results in the allocation of large strings, which has a big impact on performance. We want to display images on the browser without allocating large amounts of memory on the .NET side.Goals
Non-goals
Scenarios
Risks
Interaction with other parts of the framework
Detailed design
This is a rough sketch, but the idea is to create an object on the JS side attached to the image. Use JS interop or other means to transfer the image down to the client (at which points its not longer on the .NET memory) and display it.
Drawbacks
We'll likely want to cache these things in the browser and will have to handle what happens when the input data changes and so on in the server.
We'll likely also want to avoid performing unnecessary requests on the server to retrieve an image that has already been retrieved, which might complicate things.
Considered alternatives
The current alternatives are:
Open questions
TBD
The text was updated successfully, but these errors were encountered: