summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-10-03 01:53:27 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-10-03 14:22:34 +0200
commitc3b75b7edba5c56cd4dab24a323167b23814c6bc (patch)
tree7108009090ea773c7024fde57dd6e0be0396a206 /application/controllers/file.php
parent9b0b9a0e6082b3375ebdadc651c971671c922ebc (diff)
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 <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r--application/controllers/file.php6
1 files changed, 3 insertions, 3 deletions
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");