W3C home > Mailing lists > Public > www-svg@w3.org > August 2000

Re: images

From: Jon Ferraiolo <jferraio@Adobe.COM>
Date: Fri, 04 Aug 2000 08:43:48 -0700
Message-Id: <200008041540.IAA01043@mail-345.corp.Adobe.COM>
To: "RobertoBe" <RobertoBe.software@teseo.com>
Cc: www-svg@w3.org
You can embed images (or fonts or whatever) inline into an SVG by using the
"data" URL scheme, which documented at ftp://www.ietf.org/rfc/rfc2397.txt

The "data" URL scheme is required for Conforming SVG Viewers (see
http://www.w3.org/TR/SVG/conform.html#ConformingSVGViewers). Adobe supports
this scheme today, both as an option when exporting SVG files from Adobe
Illustrator 9 and in the Adobe SVG Viewer. I don't know about other SVG
generators or viewers.

The spec for the "data" URL scheme states that this is meant only for small
images. People should indeed avoid abusing the "data" URL scheme with large
files; nevertheless,  my understanding is that Adobe's software has no
problem with arbitrarily large files packaged using the "data" URL scheme
because it is so compellingly convenient to have all information stored
within a single file.

Here is an example of something I exported from Adobe Illustrator 9. The
original file contained only a single raster image which is a checkerboard
of red, green and blue squares. I am pretty sure that the embedded raster
file is a PNG. Anyway, here is the sample SVG file to show you what the
"data" URL scheme looks like in an SVG file:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN"
"http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd">
<!-- Generator: Adobe Illustrator 9.0, SVG Export Plug-In  -->
<svg  width="9pt" height="9pt" viewBox="0 0 9 9" xml:space="preserve">
	<g id="Layer_x0020_1"
style="fill-rule:nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:
4;">
		<image width="9" height="9"
xlink:href="data:;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAA
A/+4ADkFkb2JlAGTAAAAAAf/b
AIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxsc
Hx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f
Hx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgACQAJAwERAAIRAQMRAf/EAIEAAAMBAAAAAAAAAAAAAAAA
AAAEBgcBAAIDAQAAAAAAAAAAAAAAAAACBAUHCBAAAQMBBAsAAAAAAAAAAAAAAQIDBAASEwUGITFR
QlNzk7M1BxcRAAECAwQEDwAAAAAAAAAAAAECAwARBCESIgUyknMUMVKy0hMjQ7PTNFQGNgcX/9oA
DAMBAAIRAxEAPwCHly04sk5by2ROwWcAuTJWC2+l9s3hQguXSbNlpG4dZ07Fo6MZCN8rJtZo0eqa
0m1NqwXlXL1uJztE6IslpKlL2bPDOM4Ap6enHRKU1wAW3cM3VklboFglKVgkTCfyjE+A71WKnfsN
XxWNRznxY7/7P9Y9qL8CD1R5Njmu9ij7h82nYI7xcFf8PrNsjlsRsNYlHO0f/9k="/>
	</g>
</svg>


Jon Ferraiolo
SVG Editor
Adobe Systems Incorporated

At 03:07 PM 8/4/00 +0200, you wrote:
>Hello,
>in svg specifications I didn't find a way to embed an image in a svg
>file. Do I miss some information or image entity always point to an
>external file? I think it could be useful to have only one file rather
>than one svg and several jpg or png...
>
>Waiting to hear from you soon, regards
>____________________________________________
>Roberto Beltrami
>WANAX srl, Fermo (AP), Italy
>Tel: +39 0734 628818    Fax +39 0734 628816
>WWW: http://www.teseo.com    Email:  software@teseo.com
>
> 
> 
Received on Friday, 4 August 2000 11:44:01 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:19 GMT