Re: ISSUE-2021 (image-bbox): Bounding box of <image> subject to aspect-ratio preservation undefined [SVG Tiny 1.2]

Erik Dahlström:
> This may not affect tiny, but in 1.1 full:
> What if a referenced svg image extends outside of its viewbox? Would
> you expect the boundingbox to be tightly fitting the referenced image
> (including the overflowing parts), or to return the viewbox rect that
> was positioned inside the viewport defined by the <image> element?

I suppose it would include the overflowing parts.  The description of
preserveAspectRatio="none" says:

  Scale the graphic content of the given element non-uniformly if
  necessary such that the element's bounding box exactly matches the
  viewport rectangle.

but I think that should be saying that the element’s viewBox (or the
implied one if it’s referencing a raster) is what should be scaled to
the viewport rectangle.

> Or if there was no viewbox, but the image had width/height defined and
> there was some overflow.

It would be the same as the above case (i.e., if with a viewBox="" there
is overflowing content that contributes to the bounding box, then it
should count in this case, too).

> And would you expect the 'overflow' property to affect the boundingbox
> in such cases?

Does it normally?  I think it doesn’t, but I’m not sure.  All getBBox()
in 1.1 says is:

  Returns the tight bounding box in current user space (i.e., after
  application of the transform attribute, if any) on the geometry of all
  contained graphics elements, exclusive of stroke-width and filter
  effects).

> Since the change you propose can also affect things like clipping,
> filters and masks (that can depend on the boundingbox of the image)
> I'm wondering if you have seen any problems with this in Batik.

That’s a good point.  I haven’t noticed anything, but I haven’t been
looking in particular.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Tuesday, 22 July 2008 07:52:45 UTC