AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Streamed image not displayed

Open GerardFR opened this issue 3 years ago • 6 comments

I tried the code from the Stream image data to a client section (I copy-pasted in a new Blazor WebAssembly application), using the setImage JS function from the previous section.

The image is not displayed (only the alt image). If I remove the URL.revokeObjectURL call, the image is correctly displayed.

I suspect the URL being revoked too soon. I'm not sure how to call the revoke later (I'm not in an EditForm), so as to avoid memory leaks from that page.

(edited) Changing the last JS line seems to be working:

setTimeout(() => URL.revokeObjectURL(url), 0)


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

GerardFR avatar Jun 30 '22 07:06 GerardFR

Hello @GerardFR ... Thanks for the report.

Ping @TanayParikh for assistance.

guardrex avatar Jun 30 '22 09:06 guardrex

Hey @GerardFR, can you please confirm if you're using .NET 6? A minimal, public, GitHub repro would also assist with the investigation.

TanayParikh avatar Jun 30 '22 17:06 TanayParikh

Hi @TanayParikh , yes, I'm using .NET 6. Please see repo here: https://github.com/GerardFR/ImageStreaming/tree/master

GerardFR avatar Jul 01 '22 06:07 GerardFR

@GerardFR ... FYI, there's a delay on working doc issues at the moment due to high priority work on .NET 7. We'll get back to this ASAP 🏃😅.

guardrex avatar Jul 07 '22 17:07 guardrex

@GerardFR ... I don't have an ETA yet for returning to this. The product unit is 🏃😅 on high priority issues for .NET 7's upcoming release at the moment. We'll get back to this ASAP.

guardrex avatar Jul 15 '22 11:07 guardrex

UPDATE (8/11): We're still delayed due to the work for the upcoming .NET 7 release. We'll get to this ASAP, but I don't have an ETA yet.

guardrex avatar Aug 11 '22 14:08 guardrex

UPDATE (8/11): We're still delayed due to the work for the upcoming .NET 7 release. We'll get to this ASAP, but I don't have an ETA yet.

@guardrex I'm pretty sure this is now resolved based on the PR/issue we were discussing yesterday (onload revoke object url).

TanayParikh avatar Aug 11 '22 15:08 TanayParikh

Ok, cool. Thx, @TanayParikh. In that case, we'll just need to touch base at some point on Steve's remarks in the other issue ...

The "Preview an image provided by the InputFile component" content seems strange https://github.com/dotnet/AspNetCore.Docs/issues/26276

I wasn't quite able to grok his proposed solution for image previews. I came up with something, but it didn't match the language that he used and that you seemed to get at ...

https://github.com/dotnet/AspNetCore.Docs/issues/26276#issuecomment-1171630234

It's best for me if you could whip up a component example for what Steve is proposing. I'm fairly certain that I can understand it from the code. I'll write it up based on that.

Ok ... closing this now ... and we can continue on the other issue whenever ur free to look at it.

btw - Today, I'm buried in macOS/VS4Mac Blazor guidance ... and possibly Friday, too, because we might be working up specific VS4Mac Blazor Hybrid (.NET MAUI) tutorial guidance. Therefore, you could definitely not sweat that other issue in the near-term ... I wouldn't even be able to look at it until next week.

guardrex avatar Aug 11 '22 16:08 guardrex