13a14,43
> diff --git a/core/modules/editor/src/Form/EditorImageDialog.php b/core/modules/editor/src/Form/EditorImageDialog.php
> index 82524b6..1a633a8 100644
> --- a/core/modules/editor/src/Form/EditorImageDialog.php
> +++ b/core/modules/editor/src/Form/EditorImageDialog.php
> @@ -70,7 +70,7 @@ public function buildForm(array $form, array &$form_state, FilterFormat $filter_
> '#upload_validators' => array(
> 'file_validate_extensions' => array('gif png jpg jpeg'),
> 'file_validate_size' => array($max_filesize),
> - 'file_validate_image_resolution' => array($max_dimensions),
> + 'file_validate_image_dimensions' => array($max_dimensions),
> ),
> '#required' => TRUE,
> );
> diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
> index 2eb9bf3..65af885 100644
> --- a/core/modules/file/file.field.inc
> +++ b/core/modules/file/file.field.inc
> @@ -185,9 +185,9 @@ function template_preprocess_file_upload_help(&$variables) {
> $descriptions[] = t('Allowed types: !extensions.', array('!extensions' => String::checkPlain($upload_validators['file_validate_extensions'][0])));
> }
>
> - if (isset($upload_validators['file_validate_image_resolution'])) {
> - $max = $upload_validators['file_validate_image_resolution'][0];
> - $min = $upload_validators['file_validate_image_resolution'][1];
> + if (isset($upload_validators['file_validate_image_dimensions'])) {
> + $max = $upload_validators['file_validate_image_dimensions'][0];
> + $min = $upload_validators['file_validate_image_dimensions'][1];
> if ($min && $max && $min == $max) {
> $descriptions[] = t('Images must be exactly !size pixels.', array('!size' => '' . $max . ''));
> }
15c45
< index e1f4b28..da59231 100644
---
> index 824be6d..a2298e6 100644
18c48
< @@ -457,7 +457,7 @@ function file_validate_is_image(File $file) {
---
> @@ -447,7 +447,7 @@ function file_validate_is_image(FileInterface $file) {
22,23c52,53
< -function file_validate_image_resolution(File $file, $maximum_dimensions = 0, $minimum_dimensions = 0) {
< +function file_validate_image_dimensions(File $file, $maximum_dimensions = 0, $minimum_dimensions = 0) {
---
> -function file_validate_image_resolution(FileInterface $file, $maximum_dimensions = 0, $minimum_dimensions = 0) {
> +function file_validate_image_dimensions(FileInterface $file, $maximum_dimensions = 0, $minimum_dimensions = 0) {
28c58
< index d7f3af3..3a8fb45 100644
---
> index cb767dd..cc86ef9 100644
31c61
< @@ -58,24 +58,27 @@ function testFileValidateIsImage() {
---
> @@ -52,24 +52,27 @@ function testFileValidateIsImage() {
56c86,87
< $errors = file_validate_image_resolution($this->image, 0, '200x1');
---
> - $errors = file_validate_image_resolution($this->image, 0, '200x1');
> + $errors = file_validate_image_dimensions($this->image, 0, '200x1');
66c97
< @@ -84,7 +87,7 @@ function testFileValidateImageResolution() {
---
> @@ -78,7 +81,7 @@ function testFileValidateImageResolution() {
75c106,114
< @@ -101,7 +104,7 @@ function testFileValidateImageResolution() {
---
> @@ -88,14 +91,14 @@ function testFileValidateImageResolution() {
> // Once again, now with negative width and height to force an error.
> copy('core/misc/druplicon.png', 'temporary://druplicon.png');
> $this->image->setFileUri('temporary://druplicon.png');
> - $errors = file_validate_image_resolution($this->image, '-10x-5');
> + $errors = file_validate_image_dimensions($this->image, '-10x-5');
> $this->assertEqual(count($errors), 1, 'An error reported for an oversized image that can not be scaled down.', 'File');
>
> drupal_unlink('temporary://druplicon.png');
83a123,260
> diff --git a/core/modules/image/config/schema/image.schema.yml b/core/modules/image/config/schema/image.schema.yml
> index 4f1fc79..8869b21 100644
> --- a/core/modules/image/config/schema/image.schema.yml
> +++ b/core/modules/image/config/schema/image.schema.yml
> @@ -84,12 +84,12 @@ field.image.instance_settings:
> type: base_file_field_instance_settings
> label: 'Image settings'
> mapping:
> - max_resolution:
> + max_dimension:
> type: string
> - label: 'Maximum image resolution'
> - min_resolution:
> + label: 'Maximum image dimension'
> + min_dimension:
> type: string
> - label: 'Minimum image resolution'
> + label: 'Minimum image dimension'
> alt_field:
> type: boolean
> label: 'Enable Alt field'
> diff --git a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
> index c2e8737..ab6208e 100644
> --- a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
> +++ b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
> @@ -66,8 +66,8 @@ public static function defaultInstanceSettings() {
> 'alt_field_required' => 0,
> 'title_field' => 0,
> 'title_field_required' => 0,
> - 'max_resolution' => '',
> - 'min_resolution' => '',
> + 'max_dimensions' => '',
> + 'min_dimensions' => '',
> 'default_image' => array(
> 'fid' => NULL,
> 'alt' => '',
> @@ -188,57 +188,57 @@ public function instanceSettingsForm(array $form, array &$form_state) {
>
> $settings = $this->getSettings();
>
> - // Add maximum and minimum resolution settings.
> - $max_resolution = explode('x', $settings['max_resolution']) + array('', '');
> - $element['max_resolution'] = array(
> + // Add maximum and minimum dimension settings.
> + $max_dimensions = explode('x', $settings['max_dimensions']) + array('', '');
> + $element['max_dimensions'] = array(
> '#type' => 'item',
> - '#title' => t('Maximum image resolution'),
> - '#element_validate' => array(array(get_class($this), 'validateResolution')),
> + '#title' => t('Maximum image dimension'),
> + '#element_validate' => array(array(get_class($this), 'validateDimensions')),
> '#weight' => 4.1,
> '#field_prefix' => '
',
> '#field_suffix' => '
',
> '#description' => t('The maximum allowed image size expressed as WIDTHxHEIGHT (e.g. 640x480). 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 EXIF data in the image.', array('@url' => 'http://en.wikipedia.org/wiki/Exchangeable_image_file_format')),
> );
> - $element['max_resolution']['x'] = array(
> + $element['max_dimensions']['x'] = array(
> '#type' => 'number',
> '#title' => t('Maximum width'),
> '#title_display' => 'invisible',
> - '#default_value' => $max_resolution[0],
> + '#default_value' => $max_dimensions[0],
> '#min' => 1,
> '#field_suffix' => ' x ',
> );
> - $element['max_resolution']['y'] = array(
> + $element['max_dimensions']['y'] = array(
> '#type' => 'number',
> '#title' => t('Maximum height'),
> '#title_display' => 'invisible',
> - '#default_value' => $max_resolution[1],
> + '#default_value' => $max_dimensions[1],
> '#min' => 1,
> '#field_suffix' => ' ' . t('pixels'),
> );
>
> - $min_resolution = explode('x', $settings['min_resolution']) + array('', '');
> - $element['min_resolution'] = array(
> + $min_dimensions = explode('x', $settings['min_dimensions']) + array('', '');
> + $element['min_dimensions'] = array(
> '#type' => 'item',
> - '#title' => t('Minimum image resolution'),
> - '#element_validate' => array(array(get_class($this), 'validateResolution')),
> + '#title' => t('Minimum image dimension'),
> + '#element_validate' => array(array(get_class($this), 'validateDimensions')),
> '#weight' => 4.2,
> '#field_prefix' => '',
> '#field_suffix' => '
',
> '#description' => t('The minimum allowed image size expressed as WIDTHxHEIGHT (e.g. 640x480). Leave blank for no restriction. If a smaller image is uploaded, it will be rejected.'),
> );
> - $element['min_resolution']['x'] = array(
> + $element['min_dimensions']['x'] = array(
> '#type' => 'number',
> '#title' => t('Minimum width'),
> '#title_display' => 'invisible',
> - '#default_value' => $min_resolution[0],
> + '#default_value' => $min_dimensions[0],
> '#min' => 1,
> '#field_suffix' => ' x ',
> );
> - $element['min_resolution']['y'] = array(
> + $element['min_dimensions']['y'] = array(
> '#type' => 'number',
> '#title' => t('Minimum height'),
> '#title_display' => 'invisible',
> - '#default_value' => $min_resolution[1],
> + '#default_value' => $min_dimensions[1],
> '#min' => 1,
> '#field_suffix' => ' ' . t('pixels'),
> );
> @@ -311,9 +311,9 @@ public function preSave() {
> }
>
> /**
> - * Element validate function for resolution fields.
> + * Element validate function for dimension fields.
> */
> - public static function validateResolution($element, &$form_state) {
> + public static function validateDimensions($element, &$form_state) {
> if (!empty($element['x']['#value']) || !empty($element['y']['#value'])) {
> foreach (array('x', 'y') as $dimension) {
> if (!$element[$dimension]['#value']) {
> diff --git a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
> index 0ba9e7e..e057fcc 100644
> --- a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
> +++ b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
> @@ -115,8 +115,8 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
> $field_settings = $this->getFieldSettings();
>
> // Add upload resolution validation.
> - if ($field_settings['max_resolution'] || $field_settings['min_resolution']) {
> - $element['#upload_validators']['file_validate_image_resolution'] = array($field_settings['max_resolution'], $field_settings['min_resolution']);
> + if ($field_settings['max_dimensions'] || $field_settings['min_dimensions']) {
> + $element['#upload_validators']['file_validate_image_dimensions'] = array($field_settings['max_dimensions'], $field_settings['min_dimensions']);
> }
>
> // If not using custom extension validation, ensure this is an image.
85c262
< index 5058d2f..cd605a5 100644
---
> index 465a580..2f0bc6f 100644
88c265
< @@ -178,8 +178,8 @@ function testImageFieldSettings() {
---
> @@ -172,8 +172,8 @@ function testImageFieldSettings() {
99c276
< @@ -191,7 +191,7 @@ function testImageFieldSettings() {
---
> @@ -185,7 +185,7 @@ function testImageFieldSettings() {
109c286
< index b8b4a75..aa2d29d 100644
---
> index 96670e8..8e8c82c 100644
112,121c289,291
< @@ -14,21 +14,21 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
< public static function getInfo() {
< return array(
< 'name' => 'Image field validation tests',
< - 'description' => 'Tests validation functions such as min/max resolution.',
< + 'description' => 'Tests validation functions such as min/max dimensions.',
< 'group' => 'Image',
< );
< }
<
---
> @@ -14,15 +14,15 @@
> */
> class ImageFieldValidateTest extends ImageFieldTestBase {
141c311
< @@ -39,10 +39,10 @@ function testResolution() {
---
> @@ -33,10 +33,10 @@ function testResolution() {
154c324
< @@ -50,9 +50,9 @@ function testResolution() {
---
> @@ -44,9 +44,9 @@ function testResolution() {
165a336,350
> diff --git a/core/modules/user/src/Tests/UserCreateTest.php b/core/modules/user/src/Tests/UserCreateTest.php
> index d1bba88..7c34b0a 100644
> --- a/core/modules/user/src/Tests/UserCreateTest.php
> +++ b/core/modules/user/src/Tests/UserCreateTest.php
> @@ -59,8 +59,8 @@ protected function testUserAdd() {
> 'max_filesize' => '30 KB',
> 'alt_field' => 0,
> 'title_field' => 0,
> - 'max_resolution' => '85x85',
> - 'min_resolution' => '',
> + 'max_dimensions' => '85x85',
> + 'min_dimensions' => '',
> ),
> ))->save();
>
167c352
< index 05702fd..f337f17 100644
---
> index 31ba638..7d62936 100644
180a366,380
> diff --git a/core/profiles/standard/config/install/field.instance.user.user.user_picture.yml b/core/profiles/standard/config/install/field.instance.user.user.user_picture.yml
> index a7a2ef7..3762dc9 100644
> --- a/core/profiles/standard/config/install/field.instance.user.user.user_picture.yml
> +++ b/core/profiles/standard/config/install/field.instance.user.user.user_picture.yml
> @@ -15,8 +15,8 @@ settings:
> max_filesize: '30 KB'
> alt_field: false
> title_field: false
> - max_resolution: 85x85
> - min_resolution: ''
> + max_dimension: 85x85
> + min_dimension: ''
> default_image:
> fid: null
> alt: ''