Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as UTIF from "utif";
// $ExpectType IFD[]
const IFDs = UTIF.decode(new ArrayBuffer(64));
// $ExpectType Uint8Array
const rgba = UTIF.toRGBA8(IFDs[0]);
// $ExpectType ArrayBuffer
UTIF.encodeImage(rgba, 8, 8);
// $ExpectType ArrayBuffer
UTIF.encode(IFDs);
// $ExpectType void
UTIF.decodeImage(new ArrayBuffer(64), IFDs[0]);
// $ExpectType void
UTIF.replaceIMG();
[MIME_TYPE]: data => {
const ifds = UTIF.decode(data);
const page = ifds[0];
UTIF.decodeImages(data, ifds);
const rgba = UTIF.toRGBA8(page);
return {
data: Buffer.from(rgba),
width: page.t256[0],
height: page.t257[0]
};
}
},