From aa6ceb28b2df45d455d0cc2b070827bf3aef055e Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 17 Jan 2014 00:49:15 +0100 Subject: [PATCH] Added method to get the type of an image --- .../lib/system/image/adapter/GDImageAdapter.class.php | 7 +++++++ .../lib/system/image/adapter/IImageAdapter.class.php | 8 ++++++++ .../files/lib/system/image/adapter/ImageAdapter.class.php | 7 +++++++ .../system/image/adapter/ImagickImageAdapter.class.php | 7 +++++++ 4 files changed, 29 insertions(+) diff --git a/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php index db1da9c5be..c3e0c8c280 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php @@ -254,6 +254,13 @@ class GDImageAdapter implements IImageAdapter { return $this->height; } + /** + * @see \wcf\system\image\adapter\IImageAdapter::getType() + */ + public function getType() { + return $this->type; + } + /** * @see \wcf\system\image\adapter\IImageAdapter::getImage() */ diff --git a/wcfsetup/install/files/lib/system/image/adapter/IImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/IImageAdapter.class.php index fb8baacd5b..437f1fc57a 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/IImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/IImageAdapter.class.php @@ -146,10 +146,18 @@ interface IImageAdapter { */ public function getHeight(); + /** + * Returns the image type (GD only) + * + * @return integer + */ + public function getType(); + /** * Rotates an image the specified number of degrees. * * @param float $degrees number of degrees to rotate the image clockwise + * @return mixed */ public function rotate($degrees); diff --git a/wcfsetup/install/files/lib/system/image/adapter/ImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/ImageAdapter.class.php index 76e7a820d7..cbb85d5cec 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/ImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/ImageAdapter.class.php @@ -174,6 +174,13 @@ class ImageAdapter implements IImageAdapter { return $this->adapter->getHeight(); } + /** + * @see \wcf\system\image\adapter\IImageAdapter::getType() + */ + public function getType() { + return $this->adapter->getType(); + } + /** * @see \wcf\system\image\adapter\IImageAdapter::rotate() */ diff --git a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php index 1b9047ce45..bc42ec8623 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php @@ -194,6 +194,13 @@ class ImagickImageAdapter implements IImageAdapter { return $this->width; } + /** + * @see \wcf\system\image\adapter\IImageAdapter::getType() + */ + public function getType() { + return 0; + } + /** * @see \wcf\system\image\adapter\IImageAdapter::rotate() */ -- 2.20.1