How could be ImageFlow setup as embedded IIS solution like the ImageResizer?

295 Views Asked by At

As far as I know the Imazen ImageResizer can be used as an embedded solution in the ISS. This means that, for example, a CMS located in the same IIS I will automatically deliver the images in an adjusted size via query parameters. How this was configured can be found here.

The question is, how can this be achieved right away with Imazen's ImageFlow? In the same way that ImageFlow, like the ImageResizer at that time, automatically delivers the images resized by the IIS when they are delivered.

Currently, I have only found solutions where you develop and deploy an API with ImageFlow-dotnet-server to retrieve the images scaled over it. This has the disadvantage, however, that no credentials can be given when querying directly via an src-attribute of an img-Tag and thus no protection of the content is possible. If e.g. a CMS will deliver the content with images and ImageFlow just scales the images on delivery, I have automatically the authentication of the CMS for protection.

Do you have any ideas or approaches for an embedded solution with ImageFlow in a self-hosted IIS, like ImageResizer supports?


Update #1 // 2020-07-23 // extend description

I'm using the CMS DNN (DotNetNuke), the image path in an img-Tag is relativ like /Portals/1/myImage.jpg. Hence with ImageResizer I have just to add query parameter for resizing like /Portals/1/myImage.jpg?width=400 before delivering the contentn to the client. This is possible, because I'm using the embedded solution by adding the ImageResizer.dll to IIS-Web root and extending the web.config.
For ImageFlow I have implemented a stand-alone ASP.NET Core Web App like described on GitHub. So it's deployed in its own IIS-Web, not like ImageResizer in the DNN IIS-Web directory. Therefore, I have to load the images via the ImageFlow API like https://my-img-flw/Portals/1/myImage.jpg?width=400, because the ImageFlow service has access to the DNN files by file system. That's configured by .SetMapWebRoot(false).MapPath("/", physicalPath). But that's not an embedded approach like ImageResizer provides, because I have two separate IIS-Webs.

If further information is needed, please let me know. Thank's in advance!

1

There are 1 best solutions below

1
On

Because Imageflow.NET Server is written for ASP.NET Core, and you're on ASP.NET 4.x, you can't use them in the same application and take advantage of blended authorization systems. You would have to duplicate your authorization system in ASP.NET Core.

ImageResizer 5 will bring Imageflow to ASP.NET 4.x, so you could also consider waiting for that. We do not have an ETA yet.