You are here

protected function ExifTagMapper::stringToIfd in File metadata manager 8.2

Same name and namespace in other branches
  1. 8 file_mdm_exif/src/ExifTagMapper.php \Drupal\file_mdm_exif\ExifTagMapper::stringToIfd()

Returns the IFD integer for an IFD literal.

Parameters

string $value: An IFD literal.

Return value

int The IFD identifier.

Throws

\Drupal\file_mdm\FileMetadataException When the IFD could not be found.

1 call to ExifTagMapper::stringToIfd()
ExifTagMapper::resolveKeyToIfdAndTag in file_mdm_exif/src/ExifTagMapper.php
Resolves a metadata 'key' to the default EXIF IFD and TAG.

File

file_mdm_exif/src/ExifTagMapper.php, line 278

Class

ExifTagMapper
Provides a mapping service for EXIF ifds and tags.

Namespace

Drupal\file_mdm_exif

Code

protected function stringToIfd($value) {
  $v = strtolower($value);
  if (isset($this
    ->getStringToIfdMap()[$v])) {
    return $this
      ->getStringToIfdMap()[$v];
  }
  throw new FileMetadataException("Invalid EXIF IFD '{$value}' specified", "EXIF");
}