dockers/texcmp/texcmp.js
function readPNG(file) {
    const deferred = Q.defer();
    const onerror = deferred.reject.bind(deferred);
    const stream = fs.createReadStream(file);
    stream.on("error", onerror);
    pngparse.parseStream(stream, function(err, image) {
        if (err) {
            console.log("Failed to load " + file);
            onerror(err);
            return;
        }
        deferred.resolve(image);
    });
    return deferred.promise;
}
function readPNG(file) {
    const deferred = Q.defer();
    const onerror = deferred.reject.bind(deferred);
    const stream = fs.createReadStream(file);
    stream.on("error", onerror);
    pngparse.parseStream(stream, function(err, image) {
        if (err) {
            console.log("Failed to load " + file);
            onerror(err);
            return;
        }
        deferred.resolve(image);
    });
    return deferred.promise;
}
function readPNG ( file ) { const deferred = Q . defer ( ) ; const onerror = deferred . reject . bind ( deferred ) ; const stream = fs . createReadStream ( file ) ; stream . on ( "error" , onerror ) ; pngparse . parseStream ( stream , function ( err , image ) { if ( err ) { console . log ( "Failed to load " + file ) ; onerror ( err ) ; return ; } deferred . resolve ( image ) ; } ) ; return deferred . promise ; }
Read given file and parse it as a PNG file.
Read given file and parse it as a PNG file .