Re: Inconsistencies when including content via the image element.

"Chris Lilley" <chris@w3.org>
> 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.

I do not agree that images "usually do not have physical dimensions", the
SVG specification requires JPEG and PNG, which are specified in
http://www.w3.org/TR/REC-png.html
and
http://www.w3.org/Graphics/JPEG/jfif3.pdf
and these both clearly show that part of the file format is the physical
dimension of the image, and the majority of image editors that I can see
make use of this image.

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

Can you clarify what should happen in the following situation:

  <image xlink:href="rect.svg" x="10" y="10" height="200" width="200"/>
  <image xlink:href="rect.png" x="10" y="200" height="200" width="200"/>

both images are 100px by 100px, the SVG version is:
<svg xmlns="http://www.w3.org/2000/svg" height="100" width="100">
  <title>Rectangle</title>
  <rect x="0" y="0" height="100" width="100"/>
</svg>

How large should the 2 rectangles appear on screen, it was my
understanding that the svg created rectangle would still be a 100px
square, but the png rectangle would be a 200px square, the ratio isn't
the problem I have it's the scaling.

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

Indeed, however this has nothing to do with my request, it's simple to
scale etc. both raster and svg images without rewriting them.  The
inability to include an image at its size in SVG is a big problem, there
are many systems which produce raster image+coordinates which wish to be
used in SVG, we can't do that unless we also know the size of the raster
image outside of the SVG, this is the problem, and the above does nothing
to address it.

Jim.

Received on Wednesday, 13 November 2002 06:35:35 UTC