W3cubDocs

/Web APIs

ImageDecoder: isTypeSupported() static method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Dedicated Web Workers.

The ImageDecoder.isTypeSupported() static method checks if a given MIME type can be decoded by the user agent.

Syntax

ImageDecoder.isTypeSupported(type)

Parameters

type

A string containing the MIME type 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.

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

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
isTypeSupported_static 94 94 133 80 No 94 133 66 No 17.0 94 No

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