Support for minimum image resolution via Dropzone

Created on 26 August 2020, over 4 years ago
Updated 22 August 2023, over 1 year ago

Problem/Motivation

Minimum image resolution is currently not supported for Media Bulk Upload.

There is Support for maximum allowed image size Fixed , which tries to implement maximum and minimum image resolution validation. But this is not using Dropzone functionalilty as far as I can see, but applying validation after the files have been uploaded.

I would prefer to have this handled via Dropzone, so files are rejected by Dropzone right away. Example: https://gitlab.com/meno/dropzone/-/wikis/FAQ#reject-images-based-on-imag...

Steps to reproduce

  • Configure minimum image resolution for an image media type target field
  • Configure bulk upload for this media type
  • Bulk Upload an image with dimensions smaller than the minimum image resolution
  • The image can be uploaded (while it is expected that it will not allow uploading)

Proposed resolution

Use https://gitlab.com/meno/dropzone/-/wikis/FAQ#reject-images-based-on-imag... and patch from here https://www.drupal.org/project/dropzonejs/issues/2927754#comment-13796310 and integrate this in Media Bulk Upload.

In cases where there are non-image media types and image media types mixed, the minimum image resolution validation will be skipped (user will be warned).

In cases where there are multiple image media types with different mininum image resolutions only on minimum image resolution will be validated (and user will be warned about that).

Maybe Support for maximum allowed image size Fixed can be used for these two cases where the Dropzone validation is not working fully.

Remaining tasks

User interface changes

Warnings will appear in the form for mixed media type combinations that do not support minimum image resolutions and for multiple image media types that only support one minimum image resolution.

API changes

None

Data model changes

None

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇩🇪Germany stefan.korn Jossgrund

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany stefan.korn Jossgrund

    rerolled for 3.x

    not sure if there should be some modifications due to dropzonejs integration now being a submodule of media_bulk_upload. It works as before if the dropzone integration is enabled. I have not tested without dropzone integration, whether there are problems and whether the minimal dimension validation is provided by the managed file element by itself.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Changing version.

Production build 0.71.5 2024