ImageResizer.AspNetCore
image resizer allows real-time image processing.
Install / Use
/learn @keyone2693/ImageResizer.AspNetCoreREADME
ImageResizer.AspNetCore
Development
You can see the DEMO here: Demo
Before posting new issues: Test samples
Current version: 2.0.x [Stable]
In this version: all main functionality working except for disk cache and watermark which will be added soon the watermark as a text just added but need some bug fix
Overview
it's for DotNetCore only
aspnetcore 2.0 +
Easy to install
Use the library as dll, reference from nuget or use this in package manager console
Install-Package ImageResizer.AspNetCore
Wiki
for using this awesome library, you only need to add two things
first: add this line of code to your Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IFileProvider>(_ => new PhysicalFileProvider(_env.WebRootPath ?? _env.ContentRootPath));
//...
services.AddImageResizer();
//...
}
you may need this:
private readonly IWebHostEnvironment _env;
public Startup(IWebHostEnvironment env)
{
_env = env;
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
Configuration = builder.Build();
}
Then this one :
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
//...
// services.AddSingleton<IFileProvider>(_ => new PhysicalFileProvider(_env.WebRootPath ?? _env.ContentRootPath));
app.UseStaticFiles();
app.UseImageResizer();
//...
}
and you can use it in your client-side(html,css,ts,...) just like below:
Simple As That Enjoy :))
<img src="~/images/mardinCity.jpg?w=200" />
<img src="~/images/mardinCity.jpg?h=300" />
<img src="~/images/mardinCity.jpg?format=png" />
<img src="~/images/mardinCity.jpg?format=jpg" />
<img src="~/images/mardinCity.jpg?format=jpeg" />
<img src="~/images/mardinCity.jpg?w=100&h=200&mode=pad" />
<img src="~/images/mardinCity.jpg?w=100&h=200&mode=max" />
<img src="~/images/mardinCity.jpg?w=100&h=200&mode=crop" />
<img src="~/images/mardinCity.jpg?w=100&h=200&mode=stretch" />
<img src="~/images/mardinCity.jpg?autorotate=true" />
<img src="~/images/mardinCity.jpg?autorotate=false" />
<img src="~/images/mardinCity.jpg?quality=5" />
<img src="~/images/mardinCity.jpg?w=400&quality=80" />
Related Skills
node-connect
341.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.4kCommit, push, and open a PR
