Newer
Older
import G = require("./globals");
import * as gfs from "./fs";
import * as fs from "fs";
let content: Buffer;
let lines: string[];
let numbers: number[];
beforeAll(() =>
{
content = fs.readFileSync("XRF-File-System/Pergamena-Medioevale/codapavone_500.txt");
lines = content.toString().split('\n');
numbers = lines.map(Number);
});
let metadata = gfs.get_metadata(numbers);
expect(metadata).toEqual({
xMin: 50088000,
xMax: 50103000,
yMin: 60086000,
yMax: 60111000,
step: 500,
direction: 'c'
});
expect(md5.Md5.hashAsciiStr(JSON.stringify(image))).toBe("0a77bca5eb4c9bdd137c753a21b98545"); // coda_pavone_500
//expect(md5.Md5.hashAsciiStr(JSON.stringify(image))).toBe("b9e7fb96f36452cc3c2350d6132b50c6"); // coda_pavone_250
let image = gfs.readImage_lc(content.toString());
console.log(md5.Md5.hashAsciiStr(JSON.stringify(image));