From 18d07b631d340885315cef79f5099151596b9d3c Mon Sep 17 00:00:00 2001 From: Remi Date: Mon, 4 Nov 2013 18:00:38 +0100 Subject: [PATCH 1/3] add plugins to save() method --- src/PHPThumb/GD.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PHPThumb/GD.php b/src/PHPThumb/GD.php index 350bf19..a03adcc 100644 --- a/src/PHPThumb/GD.php +++ b/src/PHPThumb/GD.php @@ -935,6 +935,14 @@ public function save($fileName, $format = null) } } + //Execute any plugins + if ($this->plugins) { + foreach ($this->plugins as $plugin) { + /* @var $plugin \PHPThumb\PluginInterface */ + $plugin->execute($this); + } + } + // When the interlace option equals true or false call imageinterlace else leave it to default if ($this->options['interlace'] === true) { imageinterlace($this->oldImage, 1); From fd8402318c06fadba5b8b7e149a1bd765f2fdf27 Mon Sep 17 00:00:00 2001 From: Remi Date: Mon, 4 Nov 2013 18:04:32 +0100 Subject: [PATCH 2/3] add sharpen plugin add sharpen plugin with imageconvolution method --- src/PHPThumb/Plugins/Sharpen.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/PHPThumb/Plugins/Sharpen.php diff --git a/src/PHPThumb/Plugins/Sharpen.php b/src/PHPThumb/Plugins/Sharpen.php new file mode 100644 index 0000000..cf1fbf5 --- /dev/null +++ b/src/PHPThumb/Plugins/Sharpen.php @@ -0,0 +1,22 @@ +getWorkingImage(), $sharpenMatrix, $divisor, $offset); + + } +} \ No newline at end of file From 26c1a1e78a13f7d0a788fe20f749767ec247dc12 Mon Sep 17 00:00:00 2001 From: Remi Date: Mon, 4 Nov 2013 18:07:25 +0100 Subject: [PATCH 3/3] add sharpen documentation --- src/PHPThumb/Plugins/Sharpen.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/PHPThumb/Plugins/Sharpen.php b/src/PHPThumb/Plugins/Sharpen.php index cf1fbf5..9ef0c0a 100644 --- a/src/PHPThumb/Plugins/Sharpen.php +++ b/src/PHPThumb/Plugins/Sharpen.php @@ -1,7 +1,38 @@ + * Copyright (c) 2009, Ian Selby/Gen X Design + * + * Author(s): Ian Selby + * + * Licensed under the MIT License + * Redistributions of files must retain the above copyright notice. + * + * @author Ian Selby + * @copyright Copyright (c) 2009 Gen X Design + * @link http://phpthumb.gxdlabs.com + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @version 3.0 + * @package PhpThumb + * @filesource + */ + namespace PHPThumb\Plugins; +/** + * Sharpen Lib Plugin + * + * This plugin allows you to create a sharpened version of your image + * @author Remi Heens + * @package PhpThumb + * @subpackage Plugins + */ class Sharpen implements \PHPThumb\PluginInterface { public function execute($phpthumb)