Skip to content

Image resizing for dotnet core mvc projects using ImageMagick

Notifications You must be signed in to change notification settings

timvansteenis/Q42.ImageResizert

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Build status

Q42.ImageResizert

Image resizing for dotnet core mvc projects using ImageMagick and Azure storage.

Include this package in any dot net core mvc file and /image/{imageId}?width=200&height=300&cover=true will handle imageresizing.

Configure

services.Configure<ImageResizerSettings>(Configuration.GetSection("ImageResizerSettings"));
"ImageResizerSettings": {
    "AzureConnectionString": "DefaultEndpointsProtocol=https;AccountName=<yourname>;AccountKey=<yourkey>",
    "AssetContainerName": "<yourname>",    
    "ImageCdn": "<http://optional:url>",
    "CompressionQuality": "<1-100>"
  }

Caching

By default, all images that are created and stored in imagecache/{id}-{width}-{height}. There is no mechanism for clearing these.

Razor view helper

To use the UrlHelper shorthands

<img src="@ImageResizer.GetBaseUrlForImage(item.Image)" />

add this line to _ViewImports.csthml

@inject Q42.ImageResizer.ImageResizer ImageResizer

About

Image resizing for dotnet core mvc projects using ImageMagick

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%