Convert.php in ImageMagick 8.2
File
src/Plugin/ImageToolkit/Operation/imagemagick/Convert.php
View source
<?php
namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick;
class Convert extends ImagemagickImageToolkitOperationBase {
protected function arguments() {
return [
'extension' => [
'description' => 'The new extension of the converted image',
],
];
}
protected function validateArguments(array $arguments) {
if (!in_array($arguments['extension'], $this
->getToolkit()
->getSupportedExtensions())) {
throw new \InvalidArgumentException("Invalid extension ({$arguments['extension']}) specified for the image 'convert' operation");
}
return $arguments;
}
protected function execute(array $arguments) {
$this
->getToolkit()
->arguments()
->setDestinationFormatFromExtension($arguments['extension']);
return TRUE;
}
}
Classes
Name |
Description |
Convert |
Defines imagemagick Convert operation. |