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

Read all metadata tags.

Parameters

string $file: Path to file.

bool $enable_sections: Indicate if the information is retrieve by sections or flatten.

Return value

array Values by key and optionally sections.

Overrides ExifInterface::readMetadataTags

File

src/ExifPHPExtension.php, line 127

Class

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

Namespace

Drupal\exif

Code

public function readMetadataTags($file, $enable_sections = TRUE) {
    if (!file_exists($file)) {
        return [];
    }
    $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;
}