Skip to content

Commit

Permalink
- added support for SWF (not tested)
Browse files Browse the repository at this point in the history
  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 committed Jul 8, 2008
1 parent 7168c09 commit da4d6dd
Show file tree
Hide file tree
Showing 3 changed files with 832 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Canvas.php
Expand Up @@ -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:
Expand All @@ -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)
Expand All @@ -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';
}
Expand Down

0 comments on commit da4d6dd

Please sign in to comment.