Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untitled #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 2 additions & 30 deletions classes/kohana/image/imagemagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,6 @@ class Kohana_Image_ImageMagick extends Image {
*/
protected $filetmp;

/**
* Checks if ImageMagick is enabled and bundled. Bundled GD is required for some
* methods to work.
*
* @throws Kohana_Exception
* @return boolean
*/
public static function check()
{
exec(Image_ImageMagick::get_command('convert'), $response, $status);

if ($status)
{
throw new Kohana_Exception('ImageMagick is not installed in :path, check your configuration. status :status',
array(':path'=>Image_ImageMagick::$_imagemagick,
':status'=>$status)
);
}

return Image_ImageMagick::$_checked = TRUE;
}

/**
* Runs [Image_ImageMagick::check] and loads the image.
*
Expand All @@ -51,19 +29,13 @@ public static function check()
public function __construct($file)
{
// Load ImageMagick path from config
Image_ImageMagick::$_imagemagick = Kohana::Config('imagemagick')->path;
Image_ImageMagick::$_imagemagick = Kohana::$config->load('imagemagick')->path;

if (! is_dir(Image_ImageMagick::$_imagemagick))
{
throw new Kohana_Exception('ImageMagick path is not a valid directory, check your configuration');
}

if ( ! Image_ImageMagick::$_checked)
{
// Run the install check
Image_ImageMagick::check();
}

parent::__construct($file);
}

Expand Down Expand Up @@ -576,4 +548,4 @@ protected function _create($width, $height)
return FALSE;
}

} // End Kohana_Image_ImageMagic
} // End Kohana_Image_ImageMagic