You are here

protected function FontOperationTrait::getRealFontPath in Image Effects 8

Return the real path of the specified file.

Parameters

string $uri: An URI.

Return value

string The local path of the file.

1 call to FontOperationTrait::getRealFontPath()
FontOperationTrait::getFontPath in src/Plugin/ImageToolkit/Operation/FontOperationTrait.php
Return the path of the font file.

File

src/Plugin/ImageToolkit/Operation/FontOperationTrait.php, line 35

Class

FontOperationTrait
Base trait for image toolkit operations that require font handling.

Namespace

Drupal\image_effects\Plugin\ImageToolkit\Operation

Code

protected function getRealFontPath($uri) {
  $uri_wrapper = $this
    ->getStreamWrapperManagerForFontHandling()
    ->getViaUri($uri);
  if ($uri_wrapper instanceof LocalStream) {
    return $uri_wrapper
      ->realpath();
  }
  else {
    return is_file($uri) ? $uri : NULL;
  }
}