Thanks to Luc Gosso embracing the true meaning of open source software and ‘community’ (you give back at least as much as you take, in case you’re wondering) there is now a version of my ImageDataExtensions package compatible with Episerver CMS 10.
Why the long wait?
Ignoring another small package that has entirely changed how I spend my spare time, the reason is that the ImageDataExtensions package relies on a unsupported Episerver API to deliver its core resizing functionality, and I wasn’t sure what approach to take.
As part of Episerver’s quality approach they have been reducing their surface API, that is the number of methods that are available to developers to integrate and interact with the platform. This makes entire sense as they can focus their efforts on in-depth testing and validation of key features without worrying about methods that us eager developers have reflected out and used for more than their original intention.
The ThumbnailManager class that provides the resizing capability has been marked as an internal API (and moved to the Episerver.Internal namespace). Although still available to develop against, Episerver provide no promises around its operation or signature , i.e a. change to this method /API wouldn’t be considered a breaking change to the platform (though it would be for this package).
The point to remember is “if you are using this package / or you intend to, please be aware that this means your functionality could break with any Episerver release and make sure you are comfortable with how you will deal with that”.
Luc’s contribution got me thinking about how best to provide a way out for those of you that want to safely use and rely on this functionality.
I’ve now abstracted the resizing functionality into its own interface and made it pluggable through the IOC container, enabling you to provide your own resizing implementation (thus no longer depending on the Episerver Internal ThumbnailManager class)
I’ve also created a package that uses everyone’s favourite Asp.net Image resizing module (ImageResizer). There is already an Episerver integration allowing true dynamic image resizing of any image. The new add-on delegates the image resizing on upload to ImageResizer rather than the ThumbnailManager.
I’ve dropped this into another package Chief2moro.ImageDataExtensions.ImageResizer in case you’re interested.
Is now the right time to say that I think Image scaling and resizing should absolutely be part of the core platform. I rarely come across a project that doesn’t have that need 😉