You are here

public function ImagemagickToolkit::setDestinationFormatFromExtension in ImageMagick 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/ImageToolkit/ImagemagickToolkit.php \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::setDestinationFormatFromExtension()

Sets the image destination format from an image file extension.

When set, it is passed to the convert binary in the syntax "[format]:[destination]", where [format] is a string denoting an ImageMagick's image format.

Parameters

string $extension: The destination image file extension.

Return value

$this

File

src/Plugin/ImageToolkit/ImagemagickToolkit.php, line 743

Class

ImagemagickToolkit
Provides ImageMagick integration toolkit for image manipulation.

Namespace

Drupal\imagemagick\Plugin\ImageToolkit

Code

public function setDestinationFormatFromExtension($extension) {
  $format = $this->formatMapper
    ->getFormatFromExtension($extension);
  $this->destinationFormat = $format ?: '';
  return $this;
}