silverstripe/sapphire — pull request #1318 by tractorcow (2013-03-20 23:22:15+00:00)
Title: API Better detection and prevention of image resampling

Updated revision of pull request https://github.com/silverstripe/sapphire/pull/1311

This version is fully backwards compatible. Rather than changing getFormattedImage to do an automatic check on existing images, instead I've added wrapper implementations for each of the generateXXX functions, each with their own custom checks.

In implementing this I realised that functions such as SetRatioSize really do need a bit more thought put into detecting a resize, so I would consider this implementation more functionally correct.

Additional test cases included.