public function ImagemagickExecArguments::setDestinationFormatFromExtension in ImageMagick 8.3
Same name and namespace in other branches
- 8.2 src/ImagemagickExecArguments.php \Drupal\imagemagick\ImagemagickExecArguments::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/
ImagemagickExecArguments.php, line 409
Class
- ImagemagickExecArguments
- Stores arguments for execution of ImageMagick/GraphicsMagick commands.
Namespace
Drupal\imagemagickCode
public function setDestinationFormatFromExtension(string $extension) : ImagemagickExecArguments {
$this->destinationFormat = $this->execManager
->getFormatMapper()
->getFormatFromExtension($extension) ?: '';
return $this;
}