Repository navigation
Home
IsImageUrlDotNet tells whether a URL points at an image. It answers offline from the extension of the URL's path (HasImageExtension), or online by asking the server which media type it answers with (IsImageUrlAsync). It never downloads, opens or measures the image. The 1.0.2 call IsImageUrl is still there, marked obsolete, with 1.0.2's answers kept exactly, bugs included. The library is written in F# and is called the same way from C# and F#.
dotnet add package IsImageUrlDotNetusing IsImageUrlDotNet;
Console.WriteLine("https://example.com/photos/cat.PNG?w=200".HasImageExtension());
Console.WriteLine("https://example.com/report.pdf".HasImageExtension());
Console.WriteLine(await "http://images.test/avatar".IsImageUrlAsync());prints:
True
False
True
The first two answers come from the text alone. The third came from a GET request that a local stand-in answered with image/png (see how the examples were checked).
- Getting started: installing, which build each framework loads, the first calls in C# and F#.
- API reference: every member and overload, what each returns and throws, and the compiler messages you can meet.
- How URLs are checked: the rules both methods follow, the request the package sends, and how it follows redirects.
- Edge cases and errors: odd input, every exception with its message on .NET 10 and on .NET Framework, timeouts, redirects when your own client follows them.
-
Recipes: filtering a list offline, many URLs at once, deadlines, your own
HttpClient, tests without a network, F#. - Versions and upgrading: the releases, 1.0.2 and 2.0.0 side by side, and moving from 1.x.
- FAQ: short answers, each linking to the detail.
- Development: building, testing, the golden recordings of 1.0.2, releasing.
Every output on this wiki was printed by one program, run on 2026-09-29 against IsImageUrlDotNet 2.0.0 as installed from nuget.org, never against the repository's code. The program and its saved output are in the repository's ai-docs/notes (2026-09-29-wiki-verify.cs and .out.txt).
Host names ending in .test are reserved and never resolve. The program ran a local stand-in proxy for images.test, other.test and secure.test and pointed every run at it, the package's shared client included; it refused every other host. Before the first example, it checked on each framework that a request to a gate.invalid host reached the stand-in and failed there. So each online answer on these pages is what the package printed for that stand-in, not for a real site. example.com appears only in offline calls, and nothing requested it.
The C# examples ran on .NET 10, on Windows and Linux. They also ran on .NET Framework 4.8 on Windows (the package's net462 build) and on .NET 8 (its netstandard2.0 build). The F# examples ran as scripts under dotnet fsi on .NET 10. Not tested: macOS, Mono, Unity, Xamarin, and .NET Framework 4.6.2 to 4.7.2.
The current version is 2.0.0, published on nuget.org on 2026-09-27.
This wiki describes IsImageUrlDotNet 2.0.0 and was last updated on 2026-09-29. The library is MIT licensed. Report problems in the issues. On NuGet: IsImageUrlDotNet.
Using it
The releases
Contributing
Elsewhere