<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="width:100%;height:100%;background-color:#9e9d9d">
<defs>
<pattern width="100%"
height="100%"
patternContentUnits="objectBoundingBox"
id="picturePattern">
<image width="1.0" height="1.0" xlink:href="img/timg_6_thumb.jpg"></image>
</pattern>
<pattern width="100%"
height="100%"
patternContentUnits="objectBoundingBox"
id="picturePattern2">
<image width="1.0" height="1.0" xlink:href="img/timg_6.jpg"></image>
</pattern>
</defs>
<rect x="150" y="100" width="500" height="300" style="stroke-width:2px;stroke:#ff1234;fill:url('#picturePattern')"></rect>
<rect x="150" y="450" width="500" height="300" style="stroke-width:2px;stroke:#ff1234;fill:url('#picturePattern2')"></rect>
</svg>
如图所示,第一张照片被裁剪,宽度和高度为1080,第二张照片为1920 * 1080。
如何设置属性以自动适合图像?