jsjpeg.js
/**
 * Entry point. Reads the specified file and passes it to the parser.
 * 
 * @param {File} fileSpec 
 */
Entry point. Reads the specified file and passes it to the parser.

@param {File} fileSpec
Entry point . Reads the specified file and passes it to the parser . @param { File } fileSpec
function readFile(fileSpec) {
    let reader = new FileReader();
    reader.onload = function (evt) {
        let result = evt.target.result;
        parseFile(result);
    };
    reader.onerror = function (evt) {
        alert("error: " + evt);
    }
    reader.readAsArrayBuffer(fileSpec);
}
function readFile ( fileSpec ) { let reader = new FileReader ( ) ; reader . onload = function ( evt ) { let result = evt . target . result ; parseFile ( result ) ; } ; reader . onerror = function ( evt ) { alert ( "error: " + evt ) ; } reader . readAsArrayBuffer ( fileSpec ) ; }
Entry point.
Entry point .