xanweb / c5-foundation
ConcreteCMS 基础框架
v2.1.5
2024-09-27 08:48 UTC
Requires
- php: >=7.4
- symfony/polyfill-php80: ^1.20
- xanweb/c5-common: ^1.3
- xanweb/c5-helpers: ^2.1
- xanweb/c5-request: ^1.3
README
安装
将库添加到 composer.json 文件
composer require xanweb/c5-foundation
如何使用图像数据提取器
数据提取器尝试使用 IPTC 和 EXIF 元数据来填充图像信息。
在 application/config/app.php
中注册导入处理器
return [ /* * Importer processors */ 'import_processors' => [ 'xw.image.data_extractor' => \Xanweb\C5\Foundation\File\Import\Processor\DataExtractor::class, ], ];
然后,您需要将图像信息映射到属性或属性。
以下是可用的信息键列表
image_title
:图像标题artist
:艺术家名称author_title
:作者名称关键词
image_description:图像描述
评论
版权
默认映射如下
[ 'image_title' => 'title', // mapped to file title property 'comments' => 'description', // mapped to file description property 'keywords' => 'tags', // mapped to file tags property ]
要覆盖默认映射,您需要将 xanweb.php
配置文件添加到 /application/config
之下。
以下是一个可能的映射示例
<?php return [ 'file_manager' => [ 'images' => [ 'data_extractor' => [ 'image_title' => ['title', 'ak_alt'], // You can use multiple properties/attributes per field. 'comments' => 'description', 'keywords' => 'tags', 'author_title' => 'ak_author', // Use 'ak_' prefix for attributes. 'copyright' => 'ak_copyright', ] ], ], ];