Skip to content

Latest commit

 

History

History
executable file
·
15 lines (11 loc) · 506 Bytes

.verb.md

File metadata and controls

executable file
·
15 lines (11 loc) · 506 Bytes

How reliable is this?

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.

Usage

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