Skip to content

[BUG] MetaDataExtractor produces duplicated metadata values from Tika arrays #262

Description

@kitzberger

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:

  1. Upload a JPEG that has both IPTC Keywords and XMP dc:subject set to the same value
  2. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions