# Strapi 5 中已移除 isSupportedImage 方法

> Source: https://strapi.nodejs.cn/cms/migration/v4-to-v5/breaking-changes/is-supported-image-removed

🌐 The `isSupportedImage` method is removed

`isSupportedImage` 方法在 Strapi 5 中已被移除。开发者必须改用 `isImage` 或 `isOptimizableImage`。

🌐 The `isSupportedImage` method is removed in Strapi 5. Developers must use `isImage` or `isOptimizableImage` instead.

`isSupportedImage` 方法自 v4 版本以来一直发出弃用警告，并将在 Strapi 5 中最终被移除。

🌐 The `isSupportedImage` method has been issuing a deprecation warning ever since v4, and is finally being removed in Strapi 5.

此页面是[重大更改数据库](/cms/migration/v4-to-v5/breaking-changes)的一部分，提供关于重大更改的信息以及从 Strapi v4 迁移到 Strapi 5 的附加说明。

🌐 This page is part of the [breaking changes database](/cms/migration/v4-to-v5/breaking-changes) and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

- Is this breaking change affecting plugins? Yes
- Is this breaking change automatically handled by a codemod? No

## 重大变更描述 {#breaking-change-description}

🌐 Breaking change description

**在 Strapi v4 中**

`isSupportedImage` 方法被支持，但已弃用。

🌐 The `isSupportedImage` method is supported, but deprecated.

**在 Strapi 5 中**

`isSupportedImage` 方法已被移除。

🌐 The `isSupportedImage` method is removed.

开发者必须使用 `isImage` 来检查文件是否为图片，或者使用 `isOptimizableImage` 来检查该文件是否为可优化的图片。

## 手动迁移 {#manual-migration}

🌐 Manual migration

根据你的需求，将代码中 `isSupportedImage` 方法的出现替换为适当的方法 `isImage` 或 `isOptimizableImage`。请注意，Strapi v4 中的行为等同于 `isOptimizableImage`。

🌐 Replace occurences of the `isSupportedImage` method in your code by the appropriate method, `isImage` or `isOptimizableImage`, depending on your needs. Note that the behavior in Strapi v4 was equivalent to `isOptimizableImage`.
