Badgernet.Umbraco.WebPicAuto 1.1.5

dotnet add package Badgernet.Umbraco.WebPicAuto --version 1.1.5
                    
NuGet\Install-Package Badgernet.Umbraco.WebPicAuto -Version 1.1.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Badgernet.Umbraco.WebPicAuto" Version="1.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Badgernet.Umbraco.WebPicAuto" Version="1.1.5" />
                    
Directory.Packages.props
<PackageReference Include="Badgernet.Umbraco.WebPicAuto" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Badgernet.Umbraco.WebPicAuto --version 1.1.5
                    
#r "nuget: Badgernet.Umbraco.WebPicAuto, 1.1.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Badgernet.Umbraco.WebPicAuto@1.1.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Badgernet.Umbraco.WebPicAuto&version=1.1.5
                    
Install as a Cake Addin
#tool nuget:?package=Badgernet.Umbraco.WebPicAuto&version=1.1.5
                    
Install as a Cake Tool

Badgernet.Umbraco.WebPicAuto

This package will resize your images when you upload them in Umbraco. It can also convert them to .webp format to save additional storage space.


NuGet


Installation

Simply add the package by using dotnet add package to install the latest version:

dotnet add package Badgernet.Umbraco.WebPicAuto

Uninstallation

dotnet remove package Badgernet.Umbraco.WebPicAuto

After uninstalling the package, make sure to delete the folder "App_Plugins/Badgernet.Umbraco.WebPicAuto", otherwise the dashboard may still be displayed in the backoffice.


Important if using uSync

This package will also process any images imported using the uSync import feature. Be sure to turn off the converter / resizer (via the dashboard) if you do not want them to be processed.


Changelog

Version 1.1.5
  • Fix: Corrected aspect ratio calculation
  • Fix: Correctly handling EXIF Orientations
Version 1.1.4
  • Changes how images are processed in the background
Version 1.1.3
  • Adds support for processing existing image files
Version 1.1.2
  • Fix: Plays nice with uSync
Version 1.1.1
  • Fix: Adjusted namespace to "Badgernet.WebPicAuto" to prevent conflicts.
  • Fix: Removed "WpaSettings.json" from the package.
  • Converter now enabled by default
Version 1.1.0
  • Backoffice dashboard
Version 1.0.1
  • Added option to downscale images without keeping aspect ratio
  • Provide target dimensions in filename → "wparesize_800_600_ImageName.png"

Settings

You can change these default settings by accessing the "Converter/Resizer" dashboard in the Media section in backoffice. Settings are stored in a file: "App_Plugins/Badgernet.Umbraco.WebPicAuto/Backoffice/WpaSettings.json"

Resizer enabled

Turns image resizing on or off

Max width

Resizer will scale images down to fit max width value

Max height

Resizer will scale images down to fit max height

Ignore aspect ratio

By default, resizing will maintain image aspect ratio.

Converter enabled

Turns image converting on or off

Convert mode

Image encoding type

"Lossy" mode will produce smaller file size images. ← this is the preferred / default mode
"Lossless" mode will produce better quality images.

Convert quality

Value from 1 to 100

Quality of conversion, lower value will produce smaller file size images but image quality will also be worse.

Keep original images

If turned on, original images will not be deleted (wwwroot/media/***)

Ignore keyword

Any images containing this keyword in its filename will be ignored by this package. → "wpaignore_IMG01012024.png" would not get processed.


Credits

Thanks to everybody at @Our Umbraco Forum for their helpful tips.
This project was inspired by @VirjdagOnline.ImageResizer

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Aspect ratio fix