We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Export SVG with embedded WebP image

Is it possible to export SVG files having embedded WebP images?

My tests resulted in plain white output images whereas SVG files with embedded JPEG or PNG images work just fine.

Example SVG with embedded WebP image:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1280 720" width="1280" height="720">
<image href="https://www.gstatic.com/webp/gallery/2.webp" width="1280" height="720" />
</svg>

Example SVG with embedded JPEG image:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1280 720" width="1280" height="720">
<image xlink:href="https://www.gstatic.com/webp/gallery/2.jpg" width="1280" height="720" />
</svg>

For export:

var fileStream = new StreamReader($"input.svg").BaseStream;
using SvgImage image = (SvgImage)Image.Load(fileStream);
using FileStream fs = new FileStream("output.webp", FileMode.Create, FileAccess.ReadWrite);
image.Save(fs, new WebPOptions());

Thank you.

@markus.michel

Can you please share the source file with us and we shall investigate that on our end to help you further.

Thank you. Here are the used input SVG and the generated output WebP images:
embedded-webp-image.zip (623 Bytes)

@markus.michel

We need to investigate this further on our end and a ticket with ID IMAGINGNET-4862 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.