W3C home > Mailing lists > Public > www-svg@w3.org > November 2002

Re: Inconsistencies when including content via the image element.

From: Chris Lilley <chris@w3.org>
Date: Wed, 13 Nov 2002 10:03:49 +0100
Message-ID: <13954885000.20021113100349@w3.org>
To: www-svg@w3.org, "Jim Ley" <jim@jibbering.com>

Hello Jim, www-svg,

 You wrote

> The current handling of raster images in the image element is very
> problematical to me, and is inconsistent with the behaviour of svg images
> from the image element.

Its not really inconsistent, it was designed that way, but there are
more cases to consider with SVG images. Raster images do not have a
viewBox, usually do not have fixed physical dimensions (rather, they
just say how many pixes wide and high they are) and generally say
nothing about whether aspect ratio should be preserved or not.

Thus, when including a raster image, SVG treats it as it would treat
an SVG image with a predefined, implicit, viewBox corresponding to the
pixel dimensions and an implicit preserveAspectRatio.

SVG images can have all of that information. People want to make SVG
images that are flexible to include in other content, and also people
want to re-use existing content by including it at a different size,
without rewriting it.

For SVG content, we use the viewBox (if any) on the referenced SVG
content. If the referenced content has a viewBox, then
preserveAspectRatio applies, otherwise it does not. We did not provide
any mechanism to override the viewBox on the referenced SVG content
(mostly because you typically have no idea what coordinate system is
used in the referenced SVG content).

You may also notice that some viewers do not correctly handle the
preservation of aspect ratio for raster images. This is a bug in those

 Chris                          mailto:chris@w3.org
Received on Wednesday, 13 November 2002 04:03:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:54 UTC