question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] UriImageSourceService fails to load some images on Windows

See original GitHub issue

Steps to Reproduce

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
       x:Class="MauiApp3.MainPage">

    <VerticalStackLayout VerticalOptions="Start">
        <Label Text="1:"/>
        <Image MaximumHeightRequest="80" 
            Source="https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Paintedcats_Red_Star_standing.jpg/187px-Paintedcats_Red_Star_standing.jpg"/>

        <Label Text="2"/>
        <Image MaximumHeightRequest="80" 
            Source="https://upload.wikimedia.org/wikipedia/commons/f/f6/Mammuthus_exilis.jpg"/>

        <Label Text="3"/>
        <Image MaximumHeightRequest="80" 
            Source="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Sphinx2_July_2006.jpg/180px-Sphinx2_July_2006.jpg"/>
    </VerticalStackLayout>

</ContentPage>

Expected Behavior

All images are displayed.

Actual Behavior

Only the first one is displayed.

If you load the image inside a browser first then WinUI is able to load the image.

Logs:

Microsoft.Maui.UriImageSourceService: Warning: Unable to load image URI 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Sphinx2_July_2006.jpg/180px-Sphinx2_July_2006.jpg'.

System.InvalidOperationException: Unable to load image stream.
   at Microsoft.Maui.UriImageSourceService.GetImageSourceAsync(IUriImageSource imageSource, Single scale, CancellationToken cancellationToken)

Microsoft.Maui.UriImageSourceService: Warning: Unable to load image URI 'https://upload.wikimedia.org/wikipedia/commons/f/f6/Mammuthus_exilis.jpg'.

System.InvalidOperationException: Unable to load image stream.
   at Microsoft.Maui.UriImageSourceService.GetImageSourceAsync(IUriImageSource imageSource, Single scale, CancellationToken cancellationToken)

Basic Information

  • Version with issue: MAUI Preview 8
  • SKD: net6.0-windows10.0.19041

It works fine on Android.

Screenshots

image

Reproduction Link

MauiApp3.zip

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Dreamescapercommented, Nov 7, 2021

@PureWeen Yes, if I open the image in browser beforehand, it does show up.

0reactions
msftbot[bot]commented, Nov 18, 2022

Hello lovely human, thank you for your comment on this issue. Because this issue has been closed for a period of time, please strongly consider opening a new issue linking to this issue instead to ensure better visibility of your comment. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 in app images failing to load
So I am asking if anyone here may know another solution to my issue which is in some apps the built in icons...
Read more >
Recognize .NET MAUI Image loading failure - Microsoft Q&A
I'm using the .NET MAUI Image control to display images stored on disk. In rare cases an image file can be damaged, so...
Read more >
Solved: Photos Cannot Preview or Open in Windows
Methods to fix Photos Cannot Preview or Open in Windows Error · 1. Update Windows Photo Viewer · 2. Open photos in different...
Read more >
How to fix 'Windows Photo Viewer can't open this picture' ...
This post shares how you can fix 'Windows Photo Viewer can't open this picture' problem and view your photos on Windows PC.
Read more >
How to Fix the Photos File System Error in Windows 10 and ...
5. Clean Boot Windows ... To ensure there isn't a third-party app or service interfering with Photos in any way, try clean-booting Windows....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found