I have Hero banner, Application Big Image...etc media types. When uploading media images using media directories UI. Image validations (image dimensions and size provided in the media image field) are not working.

Comments

ytsurk’s picture

Assigned: Unassigned » ytsurk

Thank you for reporting this issue.

I'll have a look at this soonish ...

arjunonemail@gmail.com’s picture

Issue summary: View changes
ytsurk’s picture

Title: Media Directories Image Upload Validations (image dimensions, upload size) not working » FileUpload form does not respect all upload validations (fe. image dimensions, upload size)
Status: Active » Needs review
StatusFileSize
new3.73 KB

I can confirm that we do not respect the upload validators set by the source field (only file extensions ..).

So here a patch taking the min and max dimensions and size into account.
If no size is specified on the field, it uses the environments size.

ytsurk’s picture

StatusFileSize
new3.78 KB

Re-ordered some lines. (This patch is broken)

ytsurk’s picture

StatusFileSize
new3.87 KB

Again ..

ytsurk’s picture

StatusFileSize
new19.34 KB

The combined upload should also respect the validators, and does now :D

ytsurk’s picture

StatusFileSize
new19.35 KB

Typo

ytsurk’s picture

StatusFileSize
new19.35 KB

Removed hard-coded value ...

arjunonemail@gmail.com’s picture

StatusFileSize
new107.26 KB

Thank you ytsurk! it is working fine. for another media library issue we have already patch https://www.drupal.org/project/drupal/issues/3008292

ytsurk’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for reviewing arjun.

I re-used exactly that code from the issue you mentioned.

FYI: I opened also this core issue regarding the max filesize error message #3156949: Filename is not shown in the maximum allowed file size error message (w/o using the file_validate_size upload validator). If you expect the same, it would be nice you could add a comment there too.

ytsurk’s picture

Title: FileUpload form does not respect all upload validations (fe. image dimensions, upload size) » FileUpload and CombinedUploads forms do not respect all upload validations
Issue summary: View changes
ytsurk’s picture

Title: FileUpload and CombinedUploads forms do not respect all upload validations » FileUpload and CombinedUpload forms do not respect all upload validations
ytsurk’s picture

Assigned: ytsurk » Unassigned

  • ytsurk committed 4b0c013 on 8.x-1.x
    Issue #3156683 by ytsurk, arjun@pennywisesolutions: FileUpload and...
ytsurk’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.