You are here

public static function ExifFactory::getExifInterface in Exif 8

Same name and namespace in other branches
  1. 8.2 src/ExifFactory.php \Drupal\exif\ExifFactory::getExifInterface()
  2. 7 ExifFactory.php \Drupal\exif\ExifFactory::getExifInterface()

Return configured exif parser.

Return value

\Drupal\exif\ExifInterface configured exif parser

6 calls to ExifFactory::getExifInterface()
ExifContent::checkTitle in src/ExifContent.php
Allow to fill the title with exif data.
ExifContent::entity_insert_update in src/ExifContent.php
Main entry of the module.
ExifContent::getDataFromFileUri in src/ExifContent.php
Retrieve all metadata values from an image.
ExifFieldWidgetBase::retrieveExifFields in src/Plugin/Field/FieldWidget/ExifFieldWidgetBase.php
List of possible fields.
ExifHelp::content in src/ExifHelp.php
Return the content of the page.

... See full list

File

src/ExifFactory.php, line 33

Class

ExifFactory
Class ExifFactory allow to get right implementation.

Namespace

Drupal\exif

Code

public static function getExifInterface() {
  $config = Drupal::configFactory()
    ->get('exif.settings');
  $extractionSolution = $config
    ->get('extraction_solution');
  $useExifToolSimple = $extractionSolution == "simple_exiftool";
  if (isset($useExifToolSimple) && $useExifToolSimple && SimpleExifToolFacade::checkConfiguration()) {
    return SimpleExifToolFacade::getInstance();
  }
  else {

    // Default case for now (same behavior as previous versions)
    return ExifPHPExtension::getInstance();
  }
}