Plugins: Size validation triggering before image resize
See original GitHub issueSummary
I’m using both the Image Resize and File Validate Size plugins. I want to resize images before validating size so I loaded the Image Resize plugin before the File Validate Size plugin. Unfortunately the size validation takes place first which prevents the image resizing.
How to reproduce
FilePond.registerPlugin(
FilePondPluginImageResize,
FilePondPluginFileValidateSize
);
FilePond.setOptions({
imageResizeTargetHeight: 2160,
imageResizeTargetWidth: 3840,
imageResizeUpscale: false,
maxFileSize: '5MB'
});
FilePond.create(document.getElementById('filepond'));
Expected behaviour
The image should be resized before the size validation takes places. In this case, the resizing would reduce the size below the threshold and the image would be allowed.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Client-side image resizing with file upload on WP Job Manager
I'm using the WP Job Manager with the Field Editor plugins to show my clients a file upload field on a form where...
Read more >Smush Image Optimization Plugin Usage Documentation
This guide explains how to use Smush Pro's Image Optimizing features to compress, resize, and share all your images without sacrificing ...
Read more >How to bind resize event in my custom plugin - Stack Overflow
Method 1: You can bind the function to the resize event. It'll run your function again every time there is a resize.
Read more >jQuery Plugin To Trigger Resize Event On Multiple Elements
ResizeTriggering is a jQuery plugin to handle 'resize' event which allows to be sent to any containers when the size of the elements...
Read more >jQuery resize event - Ben Alman
Why is a plugin needed for the resize event? ... which periodically checks for element size changes and triggers the event when appropriate....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Awesome thanks rikschennink! It looks perfect.
Just published a new version of the file size validation plugin. It now exposes the
fileValidateSizeFilter
hook. You can use it to filter the files that should be validated.See code example in release: https://github.com/pqina/filepond-plugin-file-validate-size/releases/tag/2.2.0