Quote:
Originally Posted by Notjohn
That gives me an excuse to ask a question that has long puzzled me. In Sigil, when I insert a cover, this is the code that Sigil generates:
<svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 800 1169" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"><image height="1169" width="800" xlink:href="../Images/myimage.jpg"/></svg>
Why use both a relative and an absolute dimension? If the absolute dimensions (1169x800) are merely informative, why use them at all?
|
SVG is a different kettle of fish than raster images. SVG builds a canvas to place the image on. The canvas defines the screen space used and is a scale factor for the image. The image is defined on the canvas. So in effect the image takes exactly the amount of space referenced to the canvas but the canvas itself is scaled to the screen. Hence height and width are defined to 100% of the screen and the canvas is the viewBox which defines the pixel size that represents 100% and then the image fits on the canvas. The image, even tho it is raster is being displayed on a SVG generated canvas.
Dale