From c3b75b7edba5c56cd4dab24a323167b23814c6bc Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 3 Oct 2014 01:53:27 +0200 Subject: Rework image manipulation class This is the first of hopefully more classes using namespaces and proper classes that can be used as objects rather than CI's singleton approach. The namespace is mainly used to gain nice autoloading capabilities and it's not really yet used for separation. Signed-off-by: Florian Pritz --- application/controllers/file.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/file.php b/application/controllers/file.php index 1bdab2c9f..57e9d4d1d 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -316,7 +316,6 @@ class File extends MY_Controller { private function _tooltip_for_image($filedata) { - $this->load->library("imglib"); $filesize = format_bytes($filedata["filesize"]); list($width, $height) = getimagesize($this->mfile->file($filedata["hash"])); $upload_date = date("r", $filedata["date"]); @@ -517,8 +516,9 @@ class File extends MY_Controller { $thumb = cache_function($cache_key, 100, function() use ($filedata, $thumb_size){ $CI =& get_instance(); - $this->load->library("imglib"); - $thumb = $CI->imglib->makeThumb($this->mfile->file($filedata["hash"]), $thumb_size, IMAGETYPE_JPEG); + $img = new libraries\Image($this->mfile->file($filedata["hash"])); + $img->makeThumb($thumb_size, $thumb_size); + $thumb = $img->get(IMAGETYPE_JPEG); if ($thumb === false) { show_error("Failed to generate thumbnail"); -- cgit v1.2.3-24-g4f1b