filepond-plugin-image-validate-size
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -1,8 +0,9 @@ | ||
/* | ||
* FilePondPluginImageValidateSize 1.2.1 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT | ||
* Please visit https://pqina.nl/filepond for details. | ||
/*! | ||
* FilePondPluginImageValidateSize 1.2.2 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT/ | ||
* Please visit https://pqina.nl/filepond/ for details. | ||
*/ | ||
/* eslint-disable */ | ||
// test if file is of type image | ||
@@ -31,3 +32,3 @@ const isImage = file => /^image/.test(file.type); | ||
var plugin$1 = ({ addFilter, utils }) => { | ||
const plugin = ({ addFilter, utils }) => { | ||
// get quick reference to Type utils | ||
@@ -228,11 +229,11 @@ const { Type, replaceInString, isFile } = utils; | ||
// fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags | ||
const isBrowser = | ||
typeof window !== 'undefined' && typeof window.document !== 'undefined'; | ||
if (isBrowser) { | ||
document.dispatchEvent( | ||
new CustomEvent('FilePond:pluginloaded', { detail: plugin$1 }) | ||
new CustomEvent('FilePond:pluginloaded', { detail: plugin }) | ||
); | ||
} | ||
export default plugin$1; | ||
export default plugin; |
@@ -1,8 +0,9 @@ | ||
/* | ||
* FilePondPluginImageValidateSize 1.2.1 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT | ||
* Please visit https://pqina.nl/filepond for details. | ||
/*! | ||
* FilePondPluginImageValidateSize 1.2.2 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT/ | ||
* Please visit https://pqina.nl/filepond/ for details. | ||
*/ | ||
/* eslint-disable */ | ||
const isImage=e=>/^image/.test(e.type),getImageSize=e=>new Promise((i,a)=>{const t=document.createElement("img");t.src=URL.createObjectURL(e),t.onerror=(e=>{clearInterval(E),a(e)});const E=setInterval(()=>{t.naturalWidth&&t.naturalHeight&&(clearInterval(E),URL.revokeObjectURL(t.src),i({width:t.naturalWidth,height:t.naturalHeight}))},1)});var plugin$1=({addFilter:e,utils:i})=>{const{Type:a,replaceInString:t,isFile:E}=i;return e("LOAD_FILE",(e,{query:i})=>new Promise((a,_)=>{if(!E(e)||!isImage(e)||!i("GET_ALLOW_IMAGE_VALIDATE_SIZE"))return void a(e);const I={minWidth:i("GET_IMAGE_VALIDATE_SIZE_MIN_WIDTH"),minHeight:i("GET_IMAGE_VALIDATE_SIZE_MIN_HEIGHT"),maxWidth:i("GET_IMAGE_VALIDATE_SIZE_MAX_WIDTH"),maxHeight:i("GET_IMAGE_VALIDATE_SIZE_MAX_HEIGHT"),minResolution:i("GET_IMAGE_VALIDATE_SIZE_MIN_RESOLUTION"),maxResolution:i("GET_IMAGE_VALIDATE_SIZE_MAX_RESOLUTION")},l=i("GET_IMAGE_VALIDATE_SIZE_MEASURE");((e,i,a)=>new Promise((t,E)=>{const _=({width:e,height:a})=>{const{minWidth:_,minHeight:I,maxWidth:l,maxHeight:o,minResolution:n,maxResolution:T}=i,A=e*a;e<_||a<I?E("TOO_SMALL"):e>l||a>o?E("TOO_BIG"):null!==n&&A<n?E("TOO_LOW_RES"):null!==T&&A>T&&E("TOO_HIGH_RES"),t()};getImageSize(e).then(_).catch(()=>{a?a(e,i).then(_).catch(()=>E()):E()})}))(e,I,l).then(()=>{a(e)}).catch(a=>{const E=a?{TOO_SMALL:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_SIZE_TOO_SMALL"),details:i("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MIN_SIZE")},TOO_BIG:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_SIZE_TOO_BIG"),details:i("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MAX_SIZE")},TOO_LOW_RES:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_RESOLUTION_TOO_LOW"),details:i("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MIN_RESOLUTION")},TOO_HIGH_RES:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_RESOLUTION_TOO_HIGH"),details:i("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MAX_RESOLUTION")}}[a]:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_FORMAT_ERROR"),details:e.type};_({status:{main:E.label,sub:a?t(E.details,I):E.details}})})})),{options:{allowImageValidateSize:[!0,a.BOOLEAN],imageValidateSizeLabelFormatError:["Image type not supported",a.STRING],imageValidateSizeMeasure:[null,a.FUNCTION],imageValidateSizeMinResolution:[null,a.INT],imageValidateSizeMaxResolution:[null,a.INT],imageValidateSizeLabelImageResolutionTooLow:["Resolution is too low",a.STRING],imageValidateSizeLabelImageResolutionTooHigh:["Resolution is too high",a.STRING],imageValidateSizeLabelExpectedMinResolution:["Minimum resolution is {minResolution}",a.STRING],imageValidateSizeLabelExpectedMaxResolution:["Maximum resolution is {maxResolution}",a.STRING],imageValidateSizeMinWidth:[1,a.INT],imageValidateSizeMinHeight:[1,a.INT],imageValidateSizeMaxWidth:[65535,a.INT],imageValidateSizeMaxHeight:[65535,a.INT],imageValidateSizeLabelImageSizeTooSmall:["Image is too small",a.STRING],imageValidateSizeLabelImageSizeTooBig:["Image is too big",a.STRING],imageValidateSizeLabelExpectedMinSize:["Minimum size is {minWidth} × {minHeight}",a.STRING],imageValidateSizeLabelExpectedMaxSize:["Maximum size is {maxWidth} × {maxHeight}",a.STRING]}}};const isBrowser="undefined"!=typeof window&&void 0!==window.document;isBrowser&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:plugin$1}));export default plugin$1; | ||
const e=({addFilter:e,utils:i})=>{const{Type:a,replaceInString:t,isFile:E}=i,_=(e,i,a)=>new Promise((t,E)=>{const _=({width:e,height:a})=>{const{minWidth:_,minHeight:I,maxWidth:l,maxHeight:o,minResolution:T,maxResolution:n}=i,A=e*a;e<_||a<I?E("TOO_SMALL"):e>l||a>o?E("TOO_BIG"):null!==T&&A<T?E("TOO_LOW_RES"):null!==n&&A>n&&E("TOO_HIGH_RES"),t()};(e=>new Promise((i,a)=>{const t=document.createElement("img");t.src=URL.createObjectURL(e),t.onerror=(e=>{clearInterval(E),a(e)});const E=setInterval(()=>{t.naturalWidth&&t.naturalHeight&&(clearInterval(E),URL.revokeObjectURL(t.src),i({width:t.naturalWidth,height:t.naturalHeight}))},1)}))(e).then(_).catch(()=>{a?a(e,i).then(_).catch(()=>E()):E()})});return e("LOAD_FILE",(e,{query:i})=>new Promise((a,I)=>{if(!E(e)||!(e=>/^image/.test(e.type))(e)||!i("GET_ALLOW_IMAGE_VALIDATE_SIZE"))return void a(e);const l={minWidth:i("GET_IMAGE_VALIDATE_SIZE_MIN_WIDTH"),minHeight:i("GET_IMAGE_VALIDATE_SIZE_MIN_HEIGHT"),maxWidth:i("GET_IMAGE_VALIDATE_SIZE_MAX_WIDTH"),maxHeight:i("GET_IMAGE_VALIDATE_SIZE_MAX_HEIGHT"),minResolution:i("GET_IMAGE_VALIDATE_SIZE_MIN_RESOLUTION"),maxResolution:i("GET_IMAGE_VALIDATE_SIZE_MAX_RESOLUTION")},o=i("GET_IMAGE_VALIDATE_SIZE_MEASURE");_(e,l,o).then(()=>{a(e)}).catch(a=>{const E=a?{TOO_SMALL:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_SIZE_TOO_SMALL"),details:i("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MIN_SIZE")},TOO_BIG:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_SIZE_TOO_BIG"),details:i("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MAX_SIZE")},TOO_LOW_RES:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_RESOLUTION_TOO_LOW"),details:i("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MIN_RESOLUTION")},TOO_HIGH_RES:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_RESOLUTION_TOO_HIGH"),details:i("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MAX_RESOLUTION")}}[a]:{label:i("GET_IMAGE_VALIDATE_SIZE_LABEL_FORMAT_ERROR"),details:e.type};I({status:{main:E.label,sub:a?t(E.details,l):E.details}})})})),{options:{allowImageValidateSize:[!0,a.BOOLEAN],imageValidateSizeLabelFormatError:["Image type not supported",a.STRING],imageValidateSizeMeasure:[null,a.FUNCTION],imageValidateSizeMinResolution:[null,a.INT],imageValidateSizeMaxResolution:[null,a.INT],imageValidateSizeLabelImageResolutionTooLow:["Resolution is too low",a.STRING],imageValidateSizeLabelImageResolutionTooHigh:["Resolution is too high",a.STRING],imageValidateSizeLabelExpectedMinResolution:["Minimum resolution is {minResolution}",a.STRING],imageValidateSizeLabelExpectedMaxResolution:["Maximum resolution is {maxResolution}",a.STRING],imageValidateSizeMinWidth:[1,a.INT],imageValidateSizeMinHeight:[1,a.INT],imageValidateSizeMaxWidth:[65535,a.INT],imageValidateSizeMaxHeight:[65535,a.INT],imageValidateSizeLabelImageSizeTooSmall:["Image is too small",a.STRING],imageValidateSizeLabelImageSizeTooBig:["Image is too big",a.STRING],imageValidateSizeLabelExpectedMinSize:["Minimum size is {minWidth} × {minHeight}",a.STRING],imageValidateSizeLabelExpectedMaxSize:["Maximum size is {maxWidth} × {maxHeight}",a.STRING]}}};"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e}));export default e; |
@@ -1,8 +0,9 @@ | ||
/* | ||
* FilePondPluginImageValidateSize 1.2.1 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT | ||
* Please visit https://pqina.nl/filepond for details. | ||
/*! | ||
* FilePondPluginImageValidateSize 1.2.2 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT/ | ||
* Please visit https://pqina.nl/filepond/ for details. | ||
*/ | ||
/* eslint-disable */ | ||
(function(global, factory) { | ||
@@ -12,4 +13,5 @@ typeof exports === 'object' && typeof module !== 'undefined' | ||
: typeof define === 'function' && define.amd | ||
? define(factory) | ||
: (global.FilePondPluginImageValidateSize = factory()); | ||
? define(factory) | ||
: ((global = global || self), | ||
(global.FilePondPluginImageValidateSize = factory())); | ||
})(this, function() { | ||
@@ -27,2 +29,3 @@ 'use strict'; | ||
image.src = URL.createObjectURL(file); | ||
image.onerror = function(err) { | ||
@@ -32,2 +35,3 @@ clearInterval(intervalId); | ||
}; | ||
var intervalId = setInterval(function() { | ||
@@ -46,13 +50,10 @@ if (image.naturalWidth && image.naturalHeight) { | ||
var plugin$1 = function(_ref) { | ||
var plugin = function plugin(_ref) { | ||
var addFilter = _ref.addFilter, | ||
utils = _ref.utils; | ||
// get quick reference to Type utils | ||
var Type = utils.Type, | ||
replaceInString = utils.replaceInString, | ||
isFile = utils.isFile; | ||
isFile = utils.isFile; // required file size | ||
// required file size | ||
var validateFile = function validateFile(file, bounds, measure) { | ||
@@ -69,6 +70,4 @@ return new Promise(function(resolve, reject) { | ||
maxResolution = bounds.maxResolution; | ||
var resolution = width * height; // validation result | ||
var resolution = width * height; | ||
// validation result | ||
if (width < minWidth || height < minHeight) { | ||
@@ -82,5 +81,4 @@ reject('TOO_SMALL'); | ||
reject('TOO_HIGH_RES'); | ||
} | ||
} // all is well | ||
// all is well | ||
resolve(); | ||
@@ -96,5 +94,4 @@ }; | ||
return; | ||
} | ||
} // try fallback if defined by user, else reject | ||
// try fallback if defined by user, else reject | ||
measure(file, bounds) | ||
@@ -107,7 +104,6 @@ .then(onReceiveSize) | ||
}); | ||
}; | ||
// called for each file that is loaded | ||
}; // called for each file that is loaded | ||
// right before it is set to the item state | ||
// should return a promise | ||
addFilter('LOAD_FILE', function(file, _ref3) { | ||
@@ -123,5 +119,4 @@ var query = _ref3.query; | ||
return; | ||
} | ||
} // get required dimensions | ||
// get required dimensions | ||
var bounds = { | ||
@@ -134,7 +129,5 @@ minWidth: query('GET_IMAGE_VALIDATE_SIZE_MIN_WIDTH'), | ||
maxResolution: query('GET_IMAGE_VALIDATE_SIZE_MAX_RESOLUTION') | ||
}; | ||
}; // get optional custom measure function | ||
// get optional custom measure function | ||
var measure = query('GET_IMAGE_VALIDATE_SIZE_MEASURE'); | ||
validateFile(file, bounds, measure) | ||
@@ -184,3 +177,2 @@ .then(function() { | ||
}; | ||
reject({ | ||
@@ -196,5 +188,4 @@ status: { | ||
}); | ||
}); | ||
}); // expose plugin | ||
// expose plugin | ||
return { | ||
@@ -205,3 +196,2 @@ // default options | ||
allowImageValidateSize: [true, Type.BOOLEAN], | ||
// Error thrown when image can not be loaded | ||
@@ -212,6 +202,4 @@ imageValidateSizeLabelFormatError: [ | ||
], | ||
// Custom function to use as image measure | ||
imageValidateSizeMeasure: [null, Type.FUNCTION], | ||
// Required amount of pixels in the image | ||
@@ -236,9 +224,9 @@ imageValidateSizeMinResolution: [null, Type.INT], | ||
], | ||
// Required dimensions | ||
imageValidateSizeMinWidth: [1, Type.INT], // needs to be at least one pixel | ||
imageValidateSizeMinWidth: [1, Type.INT], | ||
// needs to be at least one pixel | ||
imageValidateSizeMinHeight: [1, Type.INT], | ||
imageValidateSizeMaxWidth: [65535, Type.INT], // maximum size of JPEG, fine for now I guess | ||
imageValidateSizeMaxWidth: [65535, Type.INT], | ||
// maximum size of JPEG, fine for now I guess | ||
imageValidateSizeMaxHeight: [65535, Type.INT], | ||
// Label to show when an image is too small or image is too big | ||
@@ -263,3 +251,3 @@ imageValidateSizeLabelImageSizeTooSmall: [ | ||
}; | ||
}; | ||
}; // fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags | ||
@@ -271,7 +259,9 @@ var isBrowser = | ||
document.dispatchEvent( | ||
new CustomEvent('FilePond:pluginloaded', { detail: plugin$1 }) | ||
new CustomEvent('FilePond:pluginloaded', { | ||
detail: plugin | ||
}) | ||
); | ||
} | ||
return plugin$1; | ||
return plugin; | ||
}); |
@@ -1,8 +0,9 @@ | ||
/* | ||
* FilePondPluginImageValidateSize 1.2.1 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT | ||
* Please visit https://pqina.nl/filepond for details. | ||
/*! | ||
* FilePondPluginImageValidateSize 1.2.2 | ||
* Licensed under MIT, https://opensource.org/licenses/MIT/ | ||
* Please visit https://pqina.nl/filepond/ for details. | ||
*/ | ||
/* eslint-disable */ | ||
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):e.FilePondPluginImageValidateSize=i()}(this,function(){"use strict";var e=function(e){var i=e.addFilter,t=e.utils,a=t.Type,n=t.replaceInString,I=t.isFile,l=function(i,L,t){return new Promise(function(T,A){var E,e=function(e){var i=e.width,t=e.height,a=L.minWidth,E=L.minHeight,_=L.maxWidth,n=L.maxHeight,I=L.minResolution,l=L.maxResolution,o=i*t;i<a||t<E?A("TOO_SMALL"):_<i||n<t?A("TOO_BIG"):null!==I&&o<I?A("TOO_LOW_RES"):null!==l&&l<o&&A("TOO_HIGH_RES"),T()};(E=i,new Promise(function(e,i){var t=document.createElement("img");t.src=URL.createObjectURL(E),t.onerror=function(e){clearInterval(a),i(e)};var a=setInterval(function(){t.naturalWidth&&t.naturalHeight&&(clearInterval(a),URL.revokeObjectURL(t.src),e({width:t.naturalWidth,height:t.naturalHeight}))},1)})).then(e).catch(function(){t?t(i,L).then(e).catch(function(){return A()}):A()})})};return i("LOAD_FILE",function(E,e){var _=e.query;return new Promise(function(e,t){if(I(E)&&/^image/.test(E.type)&&_("GET_ALLOW_IMAGE_VALIDATE_SIZE")){var a={minWidth:_("GET_IMAGE_VALIDATE_SIZE_MIN_WIDTH"),minHeight:_("GET_IMAGE_VALIDATE_SIZE_MIN_HEIGHT"),maxWidth:_("GET_IMAGE_VALIDATE_SIZE_MAX_WIDTH"),maxHeight:_("GET_IMAGE_VALIDATE_SIZE_MAX_HEIGHT"),minResolution:_("GET_IMAGE_VALIDATE_SIZE_MIN_RESOLUTION"),maxResolution:_("GET_IMAGE_VALIDATE_SIZE_MAX_RESOLUTION")},i=_("GET_IMAGE_VALIDATE_SIZE_MEASURE");l(E,a,i).then(function(){e(E)}).catch(function(e){var i=e?{TOO_SMALL:{label:_("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_SIZE_TOO_SMALL"),details:_("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MIN_SIZE")},TOO_BIG:{label:_("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_SIZE_TOO_BIG"),details:_("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MAX_SIZE")},TOO_LOW_RES:{label:_("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_RESOLUTION_TOO_LOW"),details:_("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MIN_RESOLUTION")},TOO_HIGH_RES:{label:_("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_RESOLUTION_TOO_HIGH"),details:_("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MAX_RESOLUTION")}}[e]:{label:_("GET_IMAGE_VALIDATE_SIZE_LABEL_FORMAT_ERROR"),details:E.type};t({status:{main:i.label,sub:e?n(i.details,a):i.details}})})}else e(E)})}),{options:{allowImageValidateSize:[!0,a.BOOLEAN],imageValidateSizeLabelFormatError:["Image type not supported",a.STRING],imageValidateSizeMeasure:[null,a.FUNCTION],imageValidateSizeMinResolution:[null,a.INT],imageValidateSizeMaxResolution:[null,a.INT],imageValidateSizeLabelImageResolutionTooLow:["Resolution is too low",a.STRING],imageValidateSizeLabelImageResolutionTooHigh:["Resolution is too high",a.STRING],imageValidateSizeLabelExpectedMinResolution:["Minimum resolution is {minResolution}",a.STRING],imageValidateSizeLabelExpectedMaxResolution:["Maximum resolution is {maxResolution}",a.STRING],imageValidateSizeMinWidth:[1,a.INT],imageValidateSizeMinHeight:[1,a.INT],imageValidateSizeMaxWidth:[65535,a.INT],imageValidateSizeMaxHeight:[65535,a.INT],imageValidateSizeLabelImageSizeTooSmall:["Image is too small",a.STRING],imageValidateSizeLabelImageSizeTooBig:["Image is too big",a.STRING],imageValidateSizeLabelExpectedMinSize:["Minimum size is {minWidth} × {minHeight}",a.STRING],imageValidateSizeLabelExpectedMaxSize:["Maximum size is {maxWidth} × {maxHeight}",a.STRING]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e}); | ||
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(e=e||self).FilePondPluginImageValidateSize=i()}(this,function(){"use strict";var e=function(e){var i=e.addFilter,t=e.utils,a=t.Type,E=t.replaceInString,n=t.isFile,_=function(e,i,t){return new Promise(function(a,E){var n=function(e){var t=e.width,n=e.height,_=i.minWidth,I=i.minHeight,l=i.maxWidth,o=i.maxHeight,T=i.minResolution,A=i.maxResolution,u=t*n;t<_||n<I?E("TOO_SMALL"):t>l||n>o?E("TOO_BIG"):null!==T&&u<T?E("TOO_LOW_RES"):null!==A&&u>A&&E("TOO_HIGH_RES"),a()};(function(e){return new Promise(function(i,t){var a=document.createElement("img");a.src=URL.createObjectURL(e),a.onerror=function(e){clearInterval(E),t(e)};var E=setInterval(function(){a.naturalWidth&&a.naturalHeight&&(clearInterval(E),URL.revokeObjectURL(a.src),i({width:a.naturalWidth,height:a.naturalHeight}))},1)})})(e).then(n).catch(function(){t?t(e,i).then(n).catch(function(){return E()}):E()})})};return i("LOAD_FILE",function(e,i){var t=i.query;return new Promise(function(i,a){if(n(e)&&function(e){return/^image/.test(e.type)}(e)&&t("GET_ALLOW_IMAGE_VALIDATE_SIZE")){var I={minWidth:t("GET_IMAGE_VALIDATE_SIZE_MIN_WIDTH"),minHeight:t("GET_IMAGE_VALIDATE_SIZE_MIN_HEIGHT"),maxWidth:t("GET_IMAGE_VALIDATE_SIZE_MAX_WIDTH"),maxHeight:t("GET_IMAGE_VALIDATE_SIZE_MAX_HEIGHT"),minResolution:t("GET_IMAGE_VALIDATE_SIZE_MIN_RESOLUTION"),maxResolution:t("GET_IMAGE_VALIDATE_SIZE_MAX_RESOLUTION")},l=t("GET_IMAGE_VALIDATE_SIZE_MEASURE");_(e,I,l).then(function(){i(e)}).catch(function(i){var n=i?{TOO_SMALL:{label:t("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_SIZE_TOO_SMALL"),details:t("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MIN_SIZE")},TOO_BIG:{label:t("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_SIZE_TOO_BIG"),details:t("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MAX_SIZE")},TOO_LOW_RES:{label:t("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_RESOLUTION_TOO_LOW"),details:t("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MIN_RESOLUTION")},TOO_HIGH_RES:{label:t("GET_IMAGE_VALIDATE_SIZE_LABEL_IMAGE_RESOLUTION_TOO_HIGH"),details:t("GET_IMAGE_VALIDATE_SIZE_LABEL_EXPECTED_MAX_RESOLUTION")}}[i]:{label:t("GET_IMAGE_VALIDATE_SIZE_LABEL_FORMAT_ERROR"),details:e.type};a({status:{main:n.label,sub:i?E(n.details,I):n.details}})})}else i(e)})}),{options:{allowImageValidateSize:[!0,a.BOOLEAN],imageValidateSizeLabelFormatError:["Image type not supported",a.STRING],imageValidateSizeMeasure:[null,a.FUNCTION],imageValidateSizeMinResolution:[null,a.INT],imageValidateSizeMaxResolution:[null,a.INT],imageValidateSizeLabelImageResolutionTooLow:["Resolution is too low",a.STRING],imageValidateSizeLabelImageResolutionTooHigh:["Resolution is too high",a.STRING],imageValidateSizeLabelExpectedMinResolution:["Minimum resolution is {minResolution}",a.STRING],imageValidateSizeLabelExpectedMaxResolution:["Maximum resolution is {maxResolution}",a.STRING],imageValidateSizeMinWidth:[1,a.INT],imageValidateSizeMinHeight:[1,a.INT],imageValidateSizeMaxWidth:[65535,a.INT],imageValidateSizeMaxHeight:[65535,a.INT],imageValidateSizeLabelImageSizeTooSmall:["Image is too small",a.STRING],imageValidateSizeLabelImageSizeTooBig:["Image is too big",a.STRING],imageValidateSizeLabelExpectedMinSize:["Minimum size is {minWidth} × {minHeight}",a.STRING],imageValidateSizeLabelExpectedMaxSize:["Maximum size is {maxWidth} × {maxHeight}",a.STRING]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e}); |
{ | ||
"name": "filepond-plugin-image-validate-size", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Image Size Validation Plugin for FilePond", | ||
"homepage": "https://pqina.nl/filepond", | ||
"license": "MIT", | ||
"author": { | ||
"name": "PQINA", | ||
"url": "https://pqina.nl/" | ||
}, | ||
"homepage": "https://pqina.nl/filepond/", | ||
"repository": "pqina/filepond-plugin-image-validate-size", | ||
@@ -10,10 +15,23 @@ "main": "dist/filepond-plugin-image-validate-size.js", | ||
"module": "dist/filepond-plugin-image-validate-size.esm.js", | ||
"license": "MIT", | ||
"author": { | ||
"name": "PQINA", | ||
"url": "https://pqina.nl" | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"start": "npx rollup -c -w", | ||
"build": "npx rollup -c" | ||
}, | ||
"peerDependencies": { | ||
"filepond": ">=1.8.x <5.x" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.4.0", | ||
"@babel/preset-env": "^7.4.2", | ||
"rollup": "^1.7.0", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^9.2.1", | ||
"rollup-plugin-license": "^0.8.1", | ||
"rollup-plugin-node-resolve": "^4.0.1", | ||
"rollup-plugin-prettier": "^0.6.0", | ||
"rollup-plugin-terser": "^4.0.4" | ||
} | ||
} |
@@ -8,1 +8,3 @@ # Image Size Validation plugin for FilePond | ||
The Image Size Validation plugin handles blocking of images whose dimensions don't fit the required minimum or maximum width and height. | ||
[Demo](https://pqina.github.io/filepond-plugin-image-validate-size/) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25596
484
9
9