Problem/Motivation

The label and help text for the maximum and minimum resolution settings on image fields could be improved.

Current text

Maximum image resolution

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 EXIF data in the image.

Minimum image resolution

The minimum allowed image size expressed as WIDTH×HEIGHT (e.g. 640×480). Leave blank for no restriction. If a smaller image is uploaded, it will be rejected.

Steps to reproduce

  1. Install Drupal
  2. Edit the image field on Article content type, or add a new image field to a content type
  3. See the help text for 'Maximum image resolution' and 'Minimum image resolution'

Proposed resolution

Update the help text to:

Maximum image dimensions

The maximum allowed image dimensions as WIDTH×HEIGHT (e.g. 640×480). Leave blank for no restriction. If a larger image is uploaded, it will be resized to the given width and height. Depending on the toolkit in use, resizing images on upload may cause the loss of image metadata.

Minimum image dimensions

The minimum allowed image dimensions as WIDTH×HEIGHT (e.g. 640×480). Leave blank for no restriction. If a smaller image is uploaded, it will be rejected.

Remaining tasks

  1. Agree on the wording change
  2. Write a patch
  3. Review

User interface changes

Before patch:

After patch:
TBC

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danyalejandro’s picture

Confirmed. The minimum image resolution description needs work as well.. Fixing this would take like 10 mins IMO.

glipay’s picture

Assigned: Unassigned » glipay
Status: Active » Needs review
FileSize
2.16 KB

I changed the maximum image resolution description to read "The maximum allowed image size expressed as width followed by height (e.g. 640 480 for a maximum with of 640 pixels and a maximum height of 480 pixels). 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." I changed the minimum image resolution descripiton to read "The minimum allowed image size expressed as width followed by height (e.g. 640 480 for a minimum width of 640 pixels and a minimum height of 480 pixels). Leave blank for no restriction. If a larger image is uploaded, it will be rejected."

joachim’s picture

Status: Needs review » Needs work

We don't need to say 'expressed as' any more. That was a bit of verbiage to mean 'you're going to have to muck around in this text field'.

We can just say 'the maximum width and height of an image'.

glipay’s picture

Status: Needs work » Needs review
FileSize
2.14 KB

here's a new patch then using the wording you sugested.

tstoeckler’s picture

Status: Needs review » Needs work

That should be "if a SMALLER file is uploaded" for minimum dimensions

glipay’s picture

Status: Needs work » Needs review
FileSize
2.14 KB

oops, I fixed the problem now

joachim’s picture

Does this need to go on 8.x first?

tstoeckler’s picture

Version: 7.x-dev » 8.x-dev

Yes, that is correct.

tstoeckler’s picture

Status: Needs review » Needs work

Also marking "needs work", because patch needs to be rerolled. It *might* apply by simply patching from within the /core directory, but I didn't try that.

RobW’s picture

Title: image field dimensions setting label doesn't match the field » Revise image field resolution settings for clearer ui and usability

There's still an 'x' in between the width and height fields, so 640 x 480 is a better description than 640 480. But maybe we should take a step back and revise the whole field for better usability.

There are suggestions in this (ancient) issue #1215730: Terminology update: don't say "Resolution" when we mean "Dimensions" that are applicable here. Dimensions and resolution mean different things.

I propose:

Maximum Image Dimensions
|_____|px width |_____|px height
If a larger image is submitted it will be resized to these dimensions, which may erase existing EXIF data. Leave blank for no restrictions.

Minimum Image Dimensions
|_____|px width |_____|px height
If a smaller image is submitted it will be rejected. Leave blank for no restrictions.

Text Changes:

  1. Add pixel suffix, width, and height to the text areas, remove them from the description. Remove the redundant repetition of the field name/purpose -- it's already there.
  2. Revise resize and exif warning in to one short statement. Less description == more betterer.

Code Changes:

  1. It probably makes sense to rename the private validation function from _image_field_resolution_validate to _image_field_dimensions_validate.
  2. To add a feature request, I think validation should only require a single dimension (width OR height Or both). That's actually what lead me to this issue.

Also, #1079116: Inaccurate text: Images must be smaller than !max pixels. is addressing similar issues, but for the node/entity edit form, not the admin UI. Noted here for reference.

RobW’s picture

"existing Exif data" could probably be replaced with the more readable and correct "image metadata". People who care will know what it's talking about. I am assuming that the resize also strips Photoshop metadata, which contains but isn't limited to Exif, although I haven't tested.

mgifford’s picture

Assigned: glipay » Unassigned
Issue summary: View changes
Issue tags: +Documentation
snehi’s picture

Assigned: Unassigned » snehi
snehi’s picture

Assigned: snehi » Unassigned
Issue tags: +Needs reroll
alvar0hurtad0’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.15 KB

This is the reroll agains 8.1.x branch

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mondrake’s picture

Issue tags: -Documentation
FileSize
2.84 KB

This new patch addresses only the UI aspects along the lines of what @RobW suggested in #10 and #11, for parts that were not addressed separately already.

  1. I did not get into renaming methods/functions/settings as that would require deprecation notices and update path for the existing fields. For just chaning names, I think too much effort vs. benefit. This can be done in D9. Maybe adding @todos?
  2. Alternative image toolkits (like e.g. ImageMagick) can retain EXIF data on resizing. So changed UI text accordingly.
mondrake’s picture

Title: Revise image field resolution settings for clearer ui and usability » Revise image field settings form for clearer ui and usability
Issue summary: View changes
FileSize
12.41 KB
13.52 KB

Screenshots:

Before:

After:

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

ranjith_kumar_k_u’s picture

Re-rolled the last patch for 9.3

Rinku Jacob 13’s picture

FileSize
54.65 KB
57.5 KB

Verified and tested patch#29 for drupal 9.3.x-dev version. Patch applied successfully and looks good to me.Adding screenshot for the reference.
Need +1 RTBC

pameeela’s picture

Title: Revise image field settings form for clearer ui and usability » Revise image field min/max settings help text form for clarity
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Bug Smash Initiative

I've updated the issue summary to reflect the current state but also to tweak the wording as I don't really think the current patch is that much of an improvement. I've taken the suggestion in #11 to simplify it by removing the EXIF reference. I think "image metadata" is clear enough.

But I'm far from an expert in this so could use someone who knows to review the proposed change.

pameeela’s picture

Issue summary: View changes

Fixed weird image sizing/spacing.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.