function GDToolkit::buildConfigurationForm

Same name in other branches
  1. 9 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::buildConfigurationForm()
  2. 8.9.x core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::buildConfigurationForm()
  3. 10 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::buildConfigurationForm()

Overrides PluginFormInterface::buildConfigurationForm

File

core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php, line 146

Class

GDToolkit
Defines the GD2 toolkit for image manipulation within Drupal.

Namespace

Drupal\system\Plugin\ImageToolkit

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form['image_jpeg_quality'] = [
        '#type' => 'number',
        '#title' => $this->t('JPEG quality'),
        '#description' => $this->t('Define the image quality for JPEG manipulations. Ranges from 0 to 100. Higher values mean better image quality but bigger files.'),
        '#min' => 0,
        '#max' => 100,
        '#default_value' => $this->configFactory
            ->getEditable('system.image.gd')
            ->get('jpeg_quality', FALSE),
        '#field_suffix' => $this->t('%'),
    ];
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.