diff options
-rw-r--r-- | README.md | 4 | ||||
-rwxr-xr-x | src/PHPImageWorkshop/ImageWorkshop.php | 35 | ||||
-rw-r--r-- | src/PHPImageWorkshop/ImageWorkshopException.php | 31 |
3 files changed, 53 insertions, 17 deletions
@@ -11,6 +11,9 @@ http://phpimageworkshop.com/ ### Latest updates
+**Version 1.3.3 - 2012-10-25**
+- Adding an ImageWorkshopException class in the project to manage exceptions
+
**Version 1.3.1 - 2012-10-17**
- Fixing a transparency bug when saving a layer as PNG which has no sublayer.
@@ -77,3 +80,4 @@ And also: - Phil Sturgeon - HappyNinjas Ltd. [philsturgeon]
- [ziadoz]
- Frank de Jonge - Ku [FrenkyNet]
+- Bjørn Børresen - Freelancer [bjornbjorn]
\ No newline at end of file diff --git a/src/PHPImageWorkshop/ImageWorkshop.php b/src/PHPImageWorkshop/ImageWorkshop.php index 2f12864..af28153 100755 --- a/src/PHPImageWorkshop/ImageWorkshop.php +++ b/src/PHPImageWorkshop/ImageWorkshop.php @@ -2,13 +2,15 @@ namespace PHPImageWorkshop;
+use PHPImageWorkshop\ImageWorkshopException;
+
/**
* ImageWorkshop class
*
* Powerful PHP class using GD library to work easily with images including layer notion (like Photoshop or GIMP).
* ImageWorkshop can be used as a layer, a group or a document.
*
- * @version 1.3.2
+ * @version 1.3.3
* @link http://phpimageworkshop.com
* @author Sybio (Clément Guillemain / @Sybio01)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
@@ -77,9 +79,24 @@ class ImageWorkshop */
protected $image;
+ /**
+ * @var integer
+ */
const ERROR_GD_NOT_INSTALLED = 1;
+
+ /**
+ * @var integer
+ */
const ERROR_NOT_AN_IMAGE_FILE = 2;
+
+ /**
+ * @var integer
+ */
const ERROR_PHP_IMAGE_VAR_NOT_USED = 3;
+
+ /**
+ * @var integer
+ */
const ERROR_IMAGE_NOT_FOUND = 4;
// Methods
@@ -2254,20 +2271,4 @@ class ImageWorkshop {
return $this->lastLayerId;
}
-}
-
-
-/**
- * ImageWorkshopException
- */
-class ImageWorkshopException extends \Exception
-{
- public function __construct($message, $code = 0, Exception $previous = null) {
- parent::__construct($message, $code, $previous);
- }
-
- public function __toString() {
- return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
- }
-
}
\ No newline at end of file diff --git a/src/PHPImageWorkshop/ImageWorkshopException.php b/src/PHPImageWorkshop/ImageWorkshopException.php new file mode 100644 index 0000000..dacce81 --- /dev/null +++ b/src/PHPImageWorkshop/ImageWorkshopException.php @@ -0,0 +1,31 @@ +<?php
+
+namespace PHPImageWorkshop;
+
+/**
+ * ImageWorkshopException
+ *
+ * Manage ImageWorkshop exceptions
+ */
+class ImageWorkshopException extends \Exception
+{
+ /**
+ * Constructor
+ *
+ * @param string $message
+ * @param integer $code
+ * @param Exception $previous
+ */
+ public function __construct($message, $code = 0, Exception $previous = null)
+ {
+ parent::__construct($message, $code, $previous);
+ }
+
+ /**
+ * __toString method
+ */
+ public function __toString()
+ {
+ return __CLASS__.": [{$this->code}]: {$this->message}\n";
+ }
+}
\ No newline at end of file |