t('Mimetype to convert to (e.g. image/jpeg, image/png, etc...)'); $form['args']['#description'] = $this->t('Additional command line arguments for ImageMagick convert (e.g. -resize 50%'); return $form; } /** * {@inheritdoc} */ public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { parent::validateConfigurationForm($form, $form_state); $exploded_mime = explode('/', $form_state->getValue('mimetype')); if ($exploded_mime[0] != "image") { $form_state->setErrorByName( 'mimetype', $this->t('Please enter an image mimetype (e.g. image/jpeg, image/png, etc...)') ); } } }