SVGImageElement.decode

The decode() method of the SVGImageElement interface initiates asynchronous decoding of an image, returning a Promise that resolves once the image data is ready for use.

Syntax

var promise = svgImageElement.decode();

Parameters

None.

Return value

A Promise which resolves once the image data is ready to be used, such as by appending it to the DOM, replacing an existing image, and so forth.

Exceptions

None.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
decode
65
79
No
No
52
No
65
65
No
47
No
9.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGImageElement/decode