This is a viewer only at the moment see the article on how this works.
To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk
This is a preview from the server running through my markdig pipeline
ImageSharp is a great library for working with images in .NET. It's fast, easy to use, and has a lot of features. In this post, I'll show you how to use ImageSharp with Docker to create a simple image processing service.
ImageSharp enables me to seamlessly work with images in .NET. It's a cross-platform library that supports a wide range of image formats and provides a simple API for image processing. It's fast, efficient, and easy to use.
However there's an issue in my setup using docker and ImageSharp. When I try to load an image from a file, I get the following error: 'Access Denied to the path /wwroot/cache/ etc...' This is caused by Docker ASP.NET installations not allowing write access to the cache directory ImageSharp uses to store temporary files.
The solution is to mount a volume in the docker container that points to a directory on the host machine. This way, the ImageSharp library can write to the cache directory without any issues.
Here's how to do it:
mostlylucid:
image: scottgal/mostlylucid:latest
volumes:
- /mnt/imagecache:/app/wwwroot/cache
Here you see I map the /app/wwwroot/cache file to a local directory on my host machine. This way, ImageSharp can write to the cache directory without any issues.
On my Ubuntu machine I created a directory /mnt/imagecache and then ran the folowing command to make it writeable (by anyone, I know this is not secure but I'm no Linux guru :))
chmod 777 -p /mnt/imagecache
In my program.cs I have this line:
builder.Services.AddImageSharp().Configure<PhysicalFileSystemCacheOptions>(options => options.CacheFolder = "cache");
As the cacheroot defaults to wwwroot this will now write to the /mnt/imagecache directory on the host machine.