static::
defaultImageForm($element,
$settings);
$element['default_image'
]['#description'
] =
$this->
t('If no image is uploaded, this image will be shown on display.'
);
return $element;
} /**
* {@inheritdoc}
*/
public function fieldSettingsForm(array
$form, FormStateInterface
$form_state) { // Get base form from FileItem.
$element = parent::
fieldSettingsForm($form,
$form_state);
$settings =
$this->
getSettings();
// Add maximum and minimum resolution settings.
$max_resolution =
explode('x',
$settings['max_resolution'
]) +
['', ''
];
$element['max_resolution'
] =
[ '#type' => 'item',
'#title' =>
$this->
t('Maximum image resolution'
),
'#element_validate' =>
[[static::
class, 'validateResolution'
]],
'#weight' => 4.1,
'#description' =>
$this->
t('The maximum allowed image size expressed as WIDTH×HEIGHT (e.g. 640×480). Leave blank for no restriction. If a larger image is uploaded, it will be resized to reflect the given width and height. Resizing images on upload will cause the loss of <a href="http://wikipedia.org/wiki/Exchangeable_image_file_format">EXIF data</a> in the image.'
),
];