Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298361

Add "Disable image resize" setting to image fields

$
0
0

Problem/Motivation

Some of our customers want to disable the image autoresize when images exceeds the maximum resolution defined in the field settings. They just want Drupal to reject the image because they are concerned about the quality of the images. So far, there is no option to change that behaviour.

Steps to reproduce

  1. Create a new content type
  2. Create an image field on that content type
  3. Set a "Maximum image resolution" of 10x10 and save the field settings
  4. Add a new node of that content type and upload an image greater than 10x10
  5. Drupal will autoresize the image down to fit the maximum resolution

Proposed resolution

Add a new radio button setting "Image resize policy" for image fields which will have two options:

  • Resize proportionally
  • Reject

The first option is the current behaviour and the second one is the new one. The first one is proposed to be default.

Also, for usability reasons, it has been decided to swap places for maximum dimensions and minimum dimensions fields. Moreover, for the same reasons, the new radio button is also shown under a fieldset.

Remaining tasks

None.

User interface changes

Check full resolution on #70 and #84.

Image field settings before patch:
Image field settings before patch

Image field settings after patch:
Image field settings after patch

Uploading oversized image with auto resize on (current situation):
Uploading oversized image with auto resize on

Uploading oversized image with auto resize off (by using new option):
Uploading oversized image with auto resize off

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 298361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>