You are here

private function SimpleExifToolFacade::toLowerJsonResult in Exif 8.2

Same name and namespace in other branches
  1. 8 src/SimpleExifToolFacade.php \Drupal\exif\SimpleExifToolFacade::toLowerJsonResult()
  2. 7 SimpleExiftoolFacade.php \Drupal\exif\SimpleExifToolFacade::tolowerJsonResult()

Translate all keys to lowercase.

ExiffTool is case sensitive. the module is not. So we need to lowercase all keys to be able to get the needed values.

Parameters

array $data: Values by keys.

Return value

array same values with lowercase keys.

1 call to SimpleExifToolFacade::toLowerJsonResult()
SimpleExifToolFacade::readAllInformation in src/SimpleExifToolFacade.php
Retrieve all metadata using exifTool.

File

src/SimpleExifToolFacade.php, line 197

Class

SimpleExifToolFacade
Class SimpleExifToolFacade.

Namespace

Drupal\exif

Code

private function toLowerJsonResult(array $data) {
  $result = [];
  foreach ($data as $section => $values) {
    if (is_array($values)) {
      $result[strtolower($section)] = array_change_key_case($values);
    }
    else {
      $result[strtolower($section)] = $values;
    }
  }
  return $result;
}