Problem/Motivation
file_validate_image_resolution() is a validation hook. Most validation hooks check a value and return an error. However, file_validate_image_resolution() does much more.
It:
- scales and image within the min/max dimensions
- saves the image
- displays status messages to the user
I believe this logic is in the wrong place for an API.
We should:
- deprecate
file_validate_image_resolution() - create a
ImageResizerservice that performs the logic or checking dimensions and resizing - Move setting messages to calling code, e.g. in upload form validators.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3363745
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kim.pepperComment #5
elberHi I just started working in this issue.
Is missing a lot of things
I will keeping working if anyone can help be welcome
Comment #6
elberchange record (https://www.drupal.org/node/3363839)
Comment #7
markdorisonThe change record for this issue has been published. It should still be a draft at this point, right?
Comment #8
kim.pepper@elber FYI change records should only be published when the issue is committed. Unpublished.
Comment #9
elberok I'm sorry should I exclude it now?
Comment #10
kim.pepperI'm going to postpone this issue on #3221793: Move file upload validation from file.module to constraint validators as we need feedback on the approach before moving any further with this issue.