You are here

public function WebP::buildConfigurationForm in ImageAPI Optimize WebP 8

Same name and namespace in other branches
  1. 2.x src/Plugin/ImageAPIOptimizeProcessor/WebP.php \Drupal\imageapi_optimize_webp\Plugin\ImageAPIOptimizeProcessor\WebP::buildConfigurationForm()

File

src/Plugin/ImageAPIOptimizeProcessor/WebP.php, line 47

Class

WebP
Plugin annotation @ImageAPIOptimizeProcessor( id = "imageapi_optimize_webp", label = @Translation("WebP Deriver"), description = @Translation("Clone image to WebP") )

Namespace

Drupal\imageapi_optimize_webp\Plugin\ImageAPIOptimizeProcessor

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {

  // @todo: Add ability to pick which image types allow derivatives.
  $form['quality'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Image quality'),
    '#description' => $this
      ->t('Specify the image quality.'),
    '#default_value' => $this->configuration['quality'],
    '#required' => TRUE,
    '#min' => 1,
    '#max' => 100,
  ];
  return $form;
}