Re: non-rectangular images & <img> tag

On 4/24/07, Matthew Raymond <mattraymond@earthlink.net> wrote:
>
> Olivier GENDRIN wrote:
> > But perhaps this should be done on the CSS side, as far it's a
> > presentational issue...
>
>    I would say so. In fact, I'd like to see something like this:
>
> | <img src="Image.png" alt="" style="crop: url('circle.svg')" />
>
>    This would allow you to use the alpha values from images and and SVG
> files to perform cropping of both images and other content.

But if you're going to want to use SVG for this, then you'd be best to
the whole thing today directly in SVG.  i.e. the SVG would contain the
"image.png" raster in an SVG:image element, then it would be masked by
a circle (or whatever) such that the image is cropped.  Then when you
deploy this in your HTML it would be:

<object type="image/svg+xml" data="cropped-image.svg" width="300" height="200">
  <img src="image.png" width="300" height="200"></img>
</object>

This would work today in browsers that support SVG and contain
fallback for those that don't.  In my mind, no need to invent a new
HTML facility for this because my assumption is that all browsers will
eventually support SVG (we're kind of waiting on Internet Explorer).

Received on Wednesday, 25 April 2007 16:25:05 UTC