Re: Inconsistencies when including content via the image element.

Hello Jim, www-svg,

 You wrote
 http://lists.w3.org/Archives/Public/www-svg/2002Jul/0011.html

> 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
viewers.

-- 
 Chris                          mailto:chris@w3.org

Received on Wednesday, 13 November 2002 04:03:51 UTC