apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

File: image2svg.php

Source Location: /XML_image2svg-0.1.1/XML/image2svg.php

Classes:

XML_image2svg

Page Details:

XML_image2svg - Image to SVG conversion

The class converts images, such as of the format JPEG, PNG and GIF to a standalone SVG representation. The image is being encoded by the PHP native encode_base64() function. You can use it to get back a complete SVG file, which is based on a predefinded, easy adaptable template file, or you can take the encoded file as a return value, using the get() method. Due to the encoding by base64, the SVG files will increase approx. 30% in size compared to the conventional image.

NOTE: Since PHP 4.0.5 GetImageSize() support has been added.

EXAMPLE: $i = &new XML_image2svg("test.jpg"); $i->tplFile = "tpl.image.svg"; $i->show();

The class allows also commandline conversion of images: C:\>php-cli -f Test_image2svg.php > test.svg

REFERENCES: http://www.ietf.org/rfc/rfc2397.txt, The "data" URL scheme http://www.ietf.org/rfc/rfc2045.txt, Multipurpose Internet Mail Extensions http://www.w3.org/Graphics/SVG/, Scalable Vector Graphics (SVG)

Includes:

require_once("PEAR.php") [line 57]
Image to svg conversion.
  • Author: Urs Gehrig <urs@circle.ch>
  • Version: $Id: image2svg.php 302251 2010-08-15 06:06:54Z clockwerx $
require_once("HTML/Template/IT.php") [line 58]

Documentation generated on Mon, 11 Mar 2019 15:38:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.