When Apache Tika Server extracts metadata from files that have the same value in both IPTC and XMP (which is standard practice — most image editors sync these), Tika returns multi-valued arrays. For example, a JPEG with IPTC Keywords="text" and XMP dc:subject="text" produces:
"Keywords": ["text", "text"],
"dc:subject": ["text", "text"],
"meta:keyword": ["text", "text"]
In MetaDataExtractor::normalizeMetaData() (line 112), these arrays are blindly imploded:
$value = implode(', ', $value);
This produces "text, text" in sys_file_metadata.keywords and sys_file_metadata.description.
Since this extractor runs at priority 100, it overrides correct values from lower-priority extractors like ExifTool (priority 90) that return clean single values.
Steps to reproduce:
- Upload a JPEG that has both IPTC Keywords and XMP dc:subject set to the same value
- Check
sys_file_metadata.keywords — it contains the value duplicated, comma-separated
Suggested fix:
$value = implode(', ', array_unique($value));
Affected versions: 13.0 (on TYPO3 13.4)
When Apache Tika Server extracts metadata from files that have the same value in both IPTC and XMP (which is standard practice — most image editors sync these), Tika returns multi-valued arrays. For example, a JPEG with IPTC Keywords="text" and XMP dc:subject="text" produces:
In
MetaDataExtractor::normalizeMetaData()(line 112), these arrays are blindly imploded:This produces "text, text" in
sys_file_metadata.keywordsandsys_file_metadata.description.Since this extractor runs at priority 100, it overrides correct values from lower-priority extractors like ExifTool (priority 90) that return clean single values.
Steps to reproduce:
sys_file_metadata.keywords— it contains the value duplicated, comma-separatedSuggested fix:
Affected versions: 13.0 (on TYPO3 13.4)