1 vote

Auto Auto Rotate

AutoAutoRotate

Dead simple image auto-rotation for Umbraco v8+

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

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.

Screenshots

 Download package
version 1.1.0

NuGet install instructions for Umbraco 8.1.0-8.17.1

Install-Package Our.Umbraco.AutoAutoRotate

Package owner

Jason Elkin

Jason Elkin

Jason has 304 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 10.0.x (untested)
Version 9.1.x (untested)
Version 9.0.x (untested)
Version 8.18.x (untested)
Version 8.17.x (untested)
Version 8.16.x (untested)
Version 8.15.x (untested)
Version 8.14.x (untested)
Version 8.13.x (untested)
Version 8.12.x (untested)
Version 8.11.x (untested)
Version 8.10.x (untested)
Version 8.9.x (untested)
Version 8.8.x (untested)
Version 8.7.x (untested)
Version 8.6.x (100%)
Version 8.5.x (untested)
Version 8.4.x (untested)
Version 8.3.x (untested)
Version 8.2.x (untested)
Version 8.1.x (100%)
Version 8.0.x (untested)
Version 7.15.x (untested)
Version 7.14.x (untested)
Version 7.13.x (untested)
Version 7.12.x (untested)
Version 7.11.x (untested)
Version 7.10.x (untested)
Version 7.9.x (untested)
Version 7.8.x (untested)
Version 7.7.x (untested)
Version 7.6.x (untested)
Version 7.5.x (untested)
Version 7.4.x (untested)
Version 7.3.x (untested)
Version 7.2.x (untested)
Version 7.1.x (untested)
Version 7.0.x (untested)

You must login before you can report on package compatibility.

Package Information

  • Package owner: Jason Elkin
  • Created: 21/08/2020
  • Current version 1.1.0
  • .NET version 4.7.2
  • License MIT
  • Downloads on Our: 74
  • Downloads on NuGet: 685
  • Total downloads : 759