xanweb / c5-foundation
ConcreteCMS Foundation
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
Installation
Include library to your composer.json
composer require xanweb/c5-foundation
How to use Image Data Extractor
Data Extractor tries to use both IPTC and EXIF metadata to fill image information.
Register importer processor within application/config/app.php
return [ /* * Importer processors */ 'import_processors' => [ 'xw.image.data_extractor' => \Xanweb\C5\Foundation\File\Import\Processor\DataExtractor::class, ], ];
You need then to map image information to properties or attributes.
Here is the list of available information keys:
image_title
: title of the imageartist
: artist nameauthor_title
: author namekeywords
image_description
comments
copyright
The default mapping is like follows:
[ 'image_title' => 'title', // mapped to file title property 'comments' => 'description', // mapped to file description property 'keywords' => 'tags', // mapped to file tags property ]
To override the default mapping you need to add xanweb.php
config file under /application/config
.
Here is an example of possible mapping:
<?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', ] ], ], ];