You are here

private function ExifPHPExtension::removeEmptyIptcKeywords in Exif 8

Same name and namespace in other branches
  1. 8.2 src/ExifPHPExtension.php \Drupal\exif\ExifPHPExtension::removeEmptyIptcKeywords()

Helper function to remove empty IPTC keywords.

Parameters

array $data: List of keywords.

Return value

array List of keywords.

1 call to ExifPHPExtension::removeEmptyIptcKeywords()
ExifPHPExtension::readIptcTags in src/ExifPHPExtension.php
Read IPTC Information from a file.

File

src/ExifPHPExtension.php, line 339

Class

ExifPHPExtension
Class ExifPHPExtension Parser implementation base d on PHP Exif extension.

Namespace

Drupal\exif

Code

private function removeEmptyIptcKeywords(array $data) {
  if (!in_array('', $data, TRUE)) {
    return $data;
  }
  foreach ($data as $key => $value) {
    if (empty($value)) {
      unset($data[$key]);
    }
  }
  return $data;
}