You are here

public function ExifPHPExtension::getMetadataFields in Exif 7

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

Going through all the fields that have been created for a given node type and try to figure out which match the naming convention -> so that we know which exif information we have to read

Naming convention are: field_exif_xxx (xxx would be the name of the exif tag to read

Parameters

$arCckFields array of CCK fields:

Return value

array a list of exif tags to read for this image

Overrides ExifInterface::getMetadataFields

File

./ExifPHPExtension.php, line 56

Class

ExifPHPExtension

Namespace

Drupal\exif

Code

public function getMetadataFields($arCckFields = array()) {
  $arSections = self::getMetadataSections();
  foreach ($arCckFields as $drupal_field => $metadata_settings) {
    $metadata_field = $metadata_settings['metadata_field'];
    $ar = explode("_", $metadata_field);
    if (isset($ar[0]) && in_array($ar[0], $arSections)) {
      $section = $ar[0];
      unset($ar[0]);
      $arCckFields[$drupal_field]['metadata_field'] = array(
        'section' => $section,
        'tag' => implode("_", $ar),
      );
    }
    else {

      //remove from the list a non usable description.
      unset($arCckFields[$drupal_field]);
      watchdog('exif', 'Not able to understand exif field settings !field', array(
        '!field' => $metadata_field,
      ), WATCHDOG_WARNING);
    }
  }
  return $arCckFields;
}