I have a strange issue I want to mask an image, to keep it simple I tried the svg way as here:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="217.714" height="321.143" viewBox="0 0 58 85">
<defs>
<mask id="a">
<path d="M22.5 0L45 31.5 22.5 63 0 31.5z" fill="#fff"/>
</mask>
</defs>
<image xlink:href="https://upload.wikimedia.org/wikipedia/commons/9/97/The_Earth_seen_from_Apollo_17.jpg" mask="url(#a)" preserveAspectRatio="xMidYMid slice" width="45" height="63" transform="translate(6.5 14.5)"/>
</svg>
My problem is when I embedded this image it seems to be transparent. When I open it in my browser it works as intended. However when I add it with a img tag like <img src="my.svg">
it takes the dimensions as defined in the svg, but it is transparent.
I tried to upload the svg, but the file type is not supported so I created a gist where it doesn't work too. That is so strange.
It should look like this:
Please tell me why this isn't working as expected. If it matter I'm using Firefox 76 on Windows 10.