@@ -123,20 +123,19 @@ class ImageResizerSettingsForm extends ConfigFormBase {
$form['resize_wrapper']['resize_type']=[
'#type'=>'select',
'#title'=>$this->t('Ensure resize type'),
'#title'=>$this->t('Resize mode'),
'#options'=>[
'min'=>$this->t('Minimum size'),
'max'=>$this->t('Maximal size'),
],
'#empty_option'=>$this->t('- Do not resize -'),
'#default_value'=>$config->get('resize_type'),
'#description'=>$this->t('Defines how the width and height settings are applied. With minimum size, both width and height of the image will '),
'#description'=>$this->t('Defines how the width and height settings are applied. With minimum size, both width and height of the image will be at least the configured limits, with maximum size, both width and height of the image will be less than the configured limits.'),
];
$form['resize_wrapper']['width']=[
'#type'=>'number',
'#title'=>$this->t('Max width'),
'#title'=>$this->t('Width'),
'#default_value'=>$config->get('width'),
'#description'=>$this->t('Images will be resized if both the width and the height of the image are above the defined values, the aspect ratio will be kept and the shorter side will be reduced to the defined size.'),
'#size'=>10,
...
...
@@ -145,7 +144,7 @@ class ImageResizerSettingsForm extends ConfigFormBase {
$form['resize_wrapper']['height']=[
'#type'=>'number',
'#title'=>$this->t('Max height'),
'#title'=>$this->t('Height'),
'#default_value'=>$config->get('height'),
'#size'=>10,
'#min'=>0,
...
...
@@ -216,6 +215,7 @@ class ImageResizerSettingsForm extends ConfigFormBase {
@@ -102,11 +102,12 @@ class ResizeTest extends BrowserTestBase {
$edit=[
'mimetypes[image/jpeg]'=>TRUE,
'resize_type'=>'min',
// Filter for images so that only one will be matched (image-test.jpg, 1901 byte).
'min_filesize'=>1900,
// Set a size that will resize most of the test images.
'width'=>20,
'height'=>20,
'width'=>10,
'height'=>10,
];
$this->saveConfiguration($edit);
$this->assertSession()->pageTextContains('The configuration options have been saved. To apply the new settings to existing images, they need to be requeued.');