Our.Umbraco.AutoAutoRotate 1.1.0

Simple image auto-rotation for Umbraco v8.x Automatically runs ImageProcessor's AutoRotate, for fire-and-forget mobile image uploads.

Install-Package Our.Umbraco.AutoAutoRotate -Version 1.1.0
dotnet add package Our.Umbraco.AutoAutoRotate --version 1.1.0
<PackageReference Include="Our.Umbraco.AutoAutoRotate" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Our.Umbraco.AutoAutoRotate --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Our.Umbraco.AutoAutoRotate, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Our.Umbraco.AutoAutoRotate as a Cake Addin
#addin nuget:?package=Our.Umbraco.AutoAutoRotate&version=1.1.0

// Install Our.Umbraco.AutoAutoRotate as a Cake Tool
#tool nuget:?package=Our.Umbraco.AutoAutoRotate&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

AutoAutoRotate

Dead simple image auto-rotation for Umbraco v8+

Automatically runs ImageProcessor's AutoRotate, for fire-and-forget mobile image uploads.

Before and after

Many images, especially those produced by mobile devices, are landscape in terms of actual pixel data but have their orientation set by EXIF data. Generally speaking this is a good thing, but the default configuration for ImageProcessor in Umbraco is to strip out the EXIF data and ignore it before resizing.

A portrait image at full size will look fine in the browser (the browser reads the EXIF data and knows what to do) but once it's processed by ImageProcessor it gets flipped back round to landscape.

As ImageProcessor's AutoRotate is already enabled by default all we need to do to fix this is append &autrotate=true to the image URL, but that can be a bit of a faff to implement everywhere.

All this package does is hook into ImageProcessor's vaidation event and add autorotate=true to every request.

If the parameter already appears in the querystring, either true or false, then it will not override it.

Config

preserveExifMetaData must be set to false and the AutoRotate plugin must be enabled in /config/imageprocessor/processing.config. These are the defaults so it should work OOTB.

<processing preserveExifMetaData="false" metaDataMode="None" fixGamma="false" interceptAllRequests="false" allowCacheBuster="true">
...
<plugin name="AutoRotate" type="ImageProcessor.Web.Processors.AutoRotate, ImageProcessor.Web" enabled="true" />

Caching

Browser caching could be a problem

You didn't actually leave images published the wrong way up on the website like that... did you...?

The querystring itself is not modified so browsers that have cached the incorrectly rotated images will keep seeing them until their cache is cleared. Clearing your cache will fix this for you (and for the backoffice) but you'll need to take manual steps to change the image URL to fix this issue for any other previous visitors.

ImageProcessor caching will not be

As far as ImageProcessor is concerned the querystring has changed so it will re-process the image and cache the new one.

AutoAutoRotate

Dead simple image auto-rotation for Umbraco v8+

Automatically runs ImageProcessor's AutoRotate, for fire-and-forget mobile image uploads.

Before and after

Many images, especially those produced by mobile devices, are landscape in terms of actual pixel data but have their orientation set by EXIF data. Generally speaking this is a good thing, but the default configuration for ImageProcessor in Umbraco is to strip out the EXIF data and ignore it before resizing.

A portrait image at full size will look fine in the browser (the browser reads the EXIF data and knows what to do) but once it's processed by ImageProcessor it gets flipped back round to landscape.

As ImageProcessor's AutoRotate is already enabled by default all we need to do to fix this is append &autrotate=true to the image URL, but that can be a bit of a faff to implement everywhere.

All this package does is hook into ImageProcessor's vaidation event and add autorotate=true to every request.

If the parameter already appears in the querystring, either true or false, then it will not override it.

Config

preserveExifMetaData must be set to false and the AutoRotate plugin must be enabled in /config/imageprocessor/processing.config. These are the defaults so it should work OOTB.

<processing preserveExifMetaData="false" metaDataMode="None" fixGamma="false" interceptAllRequests="false" allowCacheBuster="true">
...
<plugin name="AutoRotate" type="ImageProcessor.Web.Processors.AutoRotate, ImageProcessor.Web" enabled="true" />

Caching

Browser caching could be a problem

You didn't actually leave images published the wrong way up on the website like that... did you...?

The querystring itself is not modified so browsers that have cached the incorrectly rotated images will keep seeing them until their cache is cleared. Clearing your cache will fix this for you (and for the backoffice) but you'll need to take manual steps to change the image URL to fix this issue for any other previous visitors.

ImageProcessor caching will not be

As far as ImageProcessor is concerned the querystring has changed so it will re-process the image and cache the new one.

Release Notes

- Only apply autorotate when images are being further processed

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.0 87 1/30/2021
1.0.0 334 8/21/2020