summaryrefslogtreecommitdiffstats
path: root/src/exceptions
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-10-13 10:19:40 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-10-13 10:19:40 +0000
commite8d5613680eb883687d821a34fe2ad80914baee2 (patch)
treee8746b1da687c928e8b7aaed397072a14b437a99 /src/exceptions
parente61af065ecdd565683a54225911a2dd9e725acae (diff)
downloadzetacomponents-graph-e8d5613680eb883687d821a34fe2ad80914baee2.zip
zetacomponents-graph-e8d5613680eb883687d821a34fe2ad80914baee2.tar.gz
- Added first, not complete working, version of ming driver
# Image drawing causes not proper handled error, causing an inifinite loop in PHP # Font drawing causes Segmentation fault # Ming driver tests commented out for now in test suite
Diffstat (limited to 'src/exceptions')
-rw-r--r--src/exceptions/invalid_font.php35
-rw-r--r--src/exceptions/ming_bitmap_boundings.php25
-rw-r--r--src/exceptions/ming_bitmap_type.php25
3 files changed, 85 insertions, 0 deletions
diff --git a/src/exceptions/invalid_font.php b/src/exceptions/invalid_font.php
new file mode 100644
index 0000000..8376c6f
--- /dev/null
+++ b/src/exceptions/invalid_font.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * File containing the ezcGraphInvalidFontTypeException class
+ *
+ * @package Graph
+ * @version //autogen//
+ * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ */
+/**
+ * Exception thrown if font type cannot be rendered with one driver.
+ *
+ * @package Graph
+ * @version //autogen//
+ */
+class ezcGraphInvalidFontTypeException extends ezcGraphException
+{
+ public function __construct( $type, $driver )
+ {
+ $fontNames = array(
+ ezcGraph::TTF_FONT => 'True Type Font',
+ ezcGraph::PS_FONT => 'Postscript Type 1 font',
+ ezcGraph::PALM_FONT => 'Palm Font',
+ );
+
+ $fontName = ( isset( $fontNames[$type] )
+ ? $fontName = $fontNames[$type]
+ : 'Unknown'
+ );
+
+ parent::__construct( "Font type <{$fontName}> cannot be used with <{$driver}>." );
+ }
+}
+
+?>
diff --git a/src/exceptions/ming_bitmap_boundings.php b/src/exceptions/ming_bitmap_boundings.php
new file mode 100644
index 0000000..627246e
--- /dev/null
+++ b/src/exceptions/ming_bitmap_boundings.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * File containing the ezcGraphMingBitmapBoundingsException class
+ *
+ * @package Graph
+ * @version //autogen//
+ * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ */
+/**
+ * Ming does not support bitmap scaling, so that this exceptions is thrown
+ * when an image does not have the requested size.
+ *
+ * @package Graph
+ * @version //autogen//
+ */
+class ezcGraphMingBitmapBoundingsException extends ezcGraphException
+{
+ public function __construct( $imageWidth, $imageHeight, $reqWidth, $reqHeight )
+ {
+ parent::__construct( "Ming does not support bitmap scaling, so that it is up to you to scale the image <$imageWidth> * <$imageHeight> to <$reqWidth> * <$reqHeight>." );
+ }
+}
+
+?>
diff --git a/src/exceptions/ming_bitmap_type.php b/src/exceptions/ming_bitmap_type.php
new file mode 100644
index 0000000..825a907
--- /dev/null
+++ b/src/exceptions/ming_bitmap_type.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * File containing the ezcGraphMingBitmapTypeException class
+ *
+ * @package Graph
+ * @version //autogen//
+ * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ */
+/**
+ * Ming can only read non interlaced bitmaps. This exception is thrown for
+ * all other image types.
+ *
+ * @package Graph
+ * @version //autogen//
+ */
+class ezcGraphMingBitmapTypeException extends ezcGraphException
+{
+ public function __construct( $type )
+ {
+ parent::__construct( "Ming can only read non interlaced JPEGs." );
+ }
+}
+
+?>
OpenPOWER on IntegriCloud