You are here

public function ImagemagickExecArguments::setSourceFormatFromExtension in ImageMagick 8.2

Same name and namespace in other branches
  1. 8.3 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 464

Class

ImagemagickExecArguments
Stores arguments for execution of ImageMagick/GraphicsMagick commands.

Namespace

Drupal\imagemagick

Code

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