image_strip_meta
云策文档标注
概述
image_strip_meta 是一个 WordPress 过滤器,用于控制在图像调整大小时是否剥离元数据。此过滤器仅在使用 Imagick 编辑器时生效,因为 GD 编辑器默认总是剥离配置文件。
关键要点
- 过滤器名称:image_strip_meta
- 参数:$strip_meta(布尔值),决定是否在调整大小时剥离图像元数据,默认值为 true
- 应用场景:仅在使用 WP_Image_Editor_Imagick 类(如 thumbnail_image() 方法)进行图像调整大小时有效
- 引入版本:WordPress 4.5.0
代码示例
if ( apply_filters( 'image_strip_meta', $strip_meta ) ) {
// 代码逻辑
}
原文内容
Filters whether to strip metadata from images when they’re resized.
Description
This filter only applies when resizing using the Imagick editor since GD always strips profiles by default.
Parameters
$strip_metabool-
Whether to strip image metadata during resizing. Default true.
Source
if ( apply_filters( 'image_strip_meta', $strip_meta ) ) {
Changelog
| Version | Description |
|---|---|
| 4.5.0 | Introduced. |