summaryrefslogtreecommitdiff
path: root/system/libraries/drivers/Image/GraphicsMagick.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-24 19:20:36 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-24 19:20:36 -0800
commit9b6663f87a7e679ffba691cf516191fc840cf978 (patch)
tree20cf9f3aaf93b4ba69d282dcf10d259db4a752de /system/libraries/drivers/Image/GraphicsMagick.php
parent82ee5f9d338017c69331b2907f37a468ced8c66e (diff)
Update to Kohana r4684 which is now Kohana 2.4 and has substantial
changes.
Diffstat (limited to 'system/libraries/drivers/Image/GraphicsMagick.php')
-rw-r--r--system/libraries/drivers/Image/GraphicsMagick.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/system/libraries/drivers/Image/GraphicsMagick.php b/system/libraries/drivers/Image/GraphicsMagick.php
index a8bc4d9b..89b40b41 100644
--- a/system/libraries/drivers/Image/GraphicsMagick.php
+++ b/system/libraries/drivers/Image/GraphicsMagick.php
@@ -4,8 +4,8 @@
*
* @package Image
* @author Kohana Team
- * @copyright (c) 2007-2008 Kohana Team
- * @license http://kohanaphp.com/license.html
+ * @copyright (c) 2007-2009 Kohana Team
+ * @license http://kohanaphp.com/license
*/
class Image_GraphicsMagick_Driver extends Image_Driver {
@@ -31,7 +31,7 @@ class Image_GraphicsMagick_Driver extends Image_Driver {
{
// Attempt to locate GM by using "which" (only works for *nix!)
if ( ! is_file($path = exec('which gm')))
- throw new Kohana_Exception('image.graphicsmagick.not_found');
+ throw new Kohana_Exception('The GraphicsMagick directory specified does not contain a required program.');
$config['directory'] = dirname($path);
}
@@ -41,7 +41,7 @@ class Image_GraphicsMagick_Driver extends Image_Driver {
// Check to make sure the provided path is correct
if ( ! is_file(realpath($config['directory']).'/gm'.$this->ext))
- throw new Kohana_Exception('image.graphicsmagick.not_found', 'gm'.$this->ext);
+ throw new Kohana_Exception('The GraphicsMagick directory specified does not contain a required program, :gm:.', array(':gm:' => 'gm'.$this->ext));
// Set the installation directory
@@ -52,8 +52,12 @@ class Image_GraphicsMagick_Driver extends Image_Driver {
* Creates a temporary image and executes the given actions. By creating a
* temporary copy of the image before manipulating it, this process is atomic.
*/
- public function process($image, $actions, $dir, $file, $render = FALSE)
+ public function process($image, $actions, $dir, $file, $render = FALSE, $background = NULL)
{
+ // Need to implement $background support
+ if ($background !== NULL)
+ throw new Kohana_Exception('The GraphicsMagick driver does not support setting a background color');
+
// We only need the filename
$image = $image['file'];