Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Tomasz 22 posts 95 karma points
    Jan 26, 2022 @ 21:47

    umbraco9 local and remote images - imagesharp

    I'm trying to find a way to allow my umbraco9 website to serve "local" (CMS media) images via the baked in imagesharp, which is working out of the box. I've setup Azure blob storage, all working fine.

    On top of that, I am in need of serving remote images. These images sit on their respective URLs (eg., and since they are external, I want to crop/resize so that I can "fit" them into the design of my website.

    I've found the following discussion on ImageSharp, which led me to implementing the custom "remote image" provider/resolver. This works fine for the remote images, but breaks existing built in umbraco9 resizing/cropping.

    So with the "remote" solution enabled, my image src="/remote/" will be resized as expected, but src="/media/..." will not.

    I can't seem to find a way make them work "together" (ImageSharp doesn't seem to even document configuration of multiple providers either).

    Thoughts anyone?

  • Tomasz 22 posts 95 karma points
    Feb 02, 2022 @ 20:11

    Adding the startup ConfigureServices for reference:

            services.AddUmbraco(_env, _config)
                .AddContentServiceNotificationHandler() // custom ext
                .AddCustomHostedServices() // custom ext
            . . .
            services.AddHttpClient(RemoteImageResolver.HttpClientName, client =>
                client.Timeout = TimeSpan.FromSeconds(15);
                client.MaxResponseContentBufferSize = 8388608; //8mb

    And app settings section sample:

    "ImageSharp.Web": {
        "AllowedDomains": [
            "", // remote 
Please Sign in or register to post replies

Write your reply to: