- Notifications
You must be signed in to change notification settings - Fork0
Image validation utility for DOM and Node.js beyond the file extensions
License
NotificationsYou must be signed in to change notification settings
chickencoding123/image-validation
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
- Validate images in various input formats
- Validate based on image data instead of file extension
- Runs in browser ornode.js
- Graceful mode (optional) for failed images
- Comes with CLI
npm i image-validation# oryarn add image-validationconstimageValidation=require('image-validation').default// orconst{default:imageValidation}=require('image-validation')// orimportImageValidationfrom'image-validation'
Very simple to run:
// thenImageValidation('image base64 string, arrays, buffer etc...').then(result=>{// result is either true or false})// orconstresult=awaitImageValidation('image base64 string, arrays, buffer etc...')
By default the validation will throw an error for an invalid/corrupt image, but this can be changed to returnfalse and fail gracefully.
constresult=awaitImageValidation('image base64 string, arrays, buffer etc...',{throw:false})
Allows you to detect image corruption automatically which is very useful in workflows. Technically the image corruption must be fixed at source, but this is not always a possibility. In the future I'd like to add security scanning for metadata exploits and such.
About
Image validation utility for DOM and Node.js beyond the file extensions
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.