Permalink
Browse files

- added support for SWF (not tested)

  Closes bug #12122


git-svn-id: https://svn.php.net/repository/pear/packages/Image_Canvas/trunk@262261 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
Uwe Steinmann
Uwe Steinmann committed Jul 8, 2008
1 parent 7168c09 commit da4d6dd7048e9796679afc1347641c4434f3e658
Showing with 832 additions and 1 deletion.
  1. +17 −1 Canvas.php
  2. +814 −0 Canvas/SWF.php
  3. +1 −0 package.xml
View
@@ -689,6 +689,8 @@ function toHtml($params)
*
* 'svg': output in SVG format
*
+ * 'swf': output in SWF flash format (using ming extension)
+ *
* 'imagemap': output as a html image map
*
* An example of usage:
@@ -703,7 +705,8 @@ function toHtml($params)
*
* @param string $canvas The canvas type
* @param array $params The parameters for the canvas constructor
- * @return Image_Canvas The newly created canvas
+ * @return Image_Canvas The newly created canvas or
+ * PEAR_Error on error
* @static
*/
function &factory($canvas, $params)
@@ -717,6 +720,19 @@ function &factory($canvas, $params)
$canvas = 'GD_JPG';
}
+ if ($canvas == 'SWF') {
+ // return PEAR_Error object if ming extension is not installed
+ if (!extension_loaded('ming')) {
+
+ require_once 'PEAR.php';
+
+ $error = 'PHP extension ming is required for output in swf format.';
+ $error .= 'Please install the ming extension (http://de.php.net/ming).';
+ $error =& new PEAR_Error($error);
+ return $error;
+ }
+ }
+
if ($canvas == 'IMAGEMAP') {
$canvas = 'ImageMap';
}
Oops, something went wrong.

0 comments on commit da4d6dd

Please sign in to comment.