ryancramerdesign/ProcessWire — pull request #445 by horst-n (2014-04-14 16:32:32+00:00)
Title: added USM sharpening, prevent buggy PHP versions

and fixed static var in hasAlphaChannel:

- Default sharpening now is processed via UnsharpMask, to avoid this and use the basic sharpening you can set a boolean option per Pageimage 'useUSM' => false or you add it to your site/config.php under $config->imageSizerOptions

- For PHP versions with a bug in GD-libs function imageconvolution the new UnsharpMask is used automatically. Degradation to the basic method is not possible.

- Fixed a bug with a static variable in method hasAlphaChannel. This bug is reproduceable:
If you have a loop with mixed png images (with and without transparency), the value of the first image was stored and returned for all others. This could result in transparent images become black background or in not transparent images get not sharpened! (@Martijn: I think it was this one you run into earlier)
When writing this function I want avoid to open the file multiple times and thought to store it in a static variable is a good idea. But also I've thought it is static for the lifetime of one ImageSizer instance, but it seems that it is permanent for all following ImageSizer instances. (Learned something new with this)