valid-jpeg
Very simple node.js package to check if a jpeg image is valid
Installation
$ npm install valid-jpeg
Usage
// load the moduleconst imageValid = ; ... // check if image.jpg is a valid jpeg imageimageValid;
Are you kidding? A simple jpeg checker?
A simple, plug-and-play module to check if a jpeg image is valid does not exist.
This module extracts the first 2 bytes of a file and checks if they are in equals to ffd8
(the magic number used by jpeg image).
That's it! :)