You are here

public function ImagemagickExecArguments::setSourceFormatFromExtension in ImageMagick 8.3

Same name and namespace in other branches
  1. 8.2 src/ImagemagickExecArguments.php \Drupal\imagemagick\ImagemagickExecArguments::setSourceFormatFromExtension()

Sets the source image format from an image file extension.

Parameters

string $extension: The image file extension.

Return value

$this

File

src/ImagemagickExecArguments.php, line 292

Class

ImagemagickExecArguments
Stores arguments for execution of ImageMagick/GraphicsMagick commands.

Namespace

Drupal\imagemagick

Code

public function setSourceFormatFromExtension(string $extension) : ImagemagickExecArguments {
  $this->sourceFormat = $this->execManager
    ->getFormatMapper()
    ->getFormatFromExtension($extension) ?: '';
  return $this;
}