You are here

public function GDToolkit::buildConfigurationForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::buildConfigurationForm()
  2. 9 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::buildConfigurationForm()

File

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

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' => t('JPEG quality'),
    '#description' => 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' => t('%'),
  ];
  return $form;
}