You are here

public function ExifPHPExtension::readMetadataTags in Exif 7

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

$arOptions liste of options for the method : # enable_sections : (default : TRUE) retrieve also sections.

Parameters

string $file:

boolean $enable_sections:

Return value

array $data

Overrides ExifInterface::readMetadataTags

File

./ExifPHPExtension.php, line 275

Class

ExifPHPExtension

Namespace

Drupal\exif

Code

public function readMetadataTags($file, $enable_sections = TRUE) {
  if (!file_exists($file)) {
    return array();
  }
  $data1 = $this
    ->readExifTags($file, $enable_sections);
  $data2 = $this
    ->readIPTCTags($file, $enable_sections);
  $data = array_merge($data1, $data2);
  if (is_array($data)) {
    foreach ($data as $section => $section_data) {
      $section_data = $this
        ->_reformat($section_data);
      $data[$section] = $section_data;
    }
  }
  return $data;
}