This will not be correct 100% of the time. This library only returns true
when the jpeg's dimensions are undefined. However, it's possible for a jpeg to be corrupted whilst still having readble dimensions.
Takes a filepath to a .jpg
or .jpeg
file (case insensitive).
var isCorrupted = require('{%= name %}');
console.log(isCorrupted('./path/to/image/not-corrupted.jpg'));
//=> true
console.log(isCorrupted('./path/to/image/corrupted.jpg'));
//=> false