ImageDecoder: isTypeSupported() static method
WebCodecs APIwindowanddedicated
WebCodecs APIwindow_and_dedicated
The **`ImageDecoder.isTypeSupported()`** static method checks if a given [MIME type](/docs/Web/HTTP/Guides/MIME_types) can be decoded by the user agent.
## Syntax
```js-nolint
ImageDecoder.isTypeSupported(type)
```
### Parameters
- `type`
- : A string containing the [MIME type](/docs/Web/HTTP/Guides/MIME_types) to check for decoding support.
### Return value
A Promise that resolves with a boolean value indicating whether images with a format of `type` can be decoded by the API.
## Examples
The following example checks if GIF and PCX images are supported for decoding and prints the result to the console.
```js
let isGifSupported = await ImageDecoder.isTypeSupported("image/gif");
console.log(`GIF supported: ${isGifSupported}`); // Likely true.
let isPcxSupported = await ImageDecoder.isTypeSupported("image/pcx");
console.log(`PCX supported: ${isPcxSupported}`); // Probably false
```
## Specifications
## Browser compatibility
Cite this
"ImageDecoder: isTypeSupported() static method". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder/isTypeSupported_static JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy