Security News
Internet Archive Hacked, 31 Million Record Compromised
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
Processor for Windows MetaFile (WMF) files in JS (for the browser and nodejs).
With npm:
$ npm install wmf
In the browser:
<script src="wmf.js"></script>
The browser exposes a variable WMF
.
The data
argument is expected to be an ArrayBuffer
, Uint8Array
or Buffer
WMF.image_size(data)
extracts the image offset and extents, returns an Array
[width, height]
where both metrics are measured in pixels.
WMF.draw_canvas(data, canvas)
parses the WMF and draws to a Canvas
.
ImageData
is available. For nodejs-powered
canvas implementations, a shim must be exposed as a global. Using the canvas
npm package:const { createImageData } = require("canvas");
global.ImageData = createImageData;
OffscreenCanvas
in Chrome and some other Canvas implementations require
the dimensions in the constructor:const size = WMF.image_size(data);
const canvas = new OffscreenCanvas(size[0], size[1]);
// assume `canvas` is a DOM element
(async() => {
const res = await fetch("url/for/image.wmf");
const ab = await res.arrayBuffer();
WMF.draw_canvas(ab, document.getElementById("canvas"));
})();
const { createCanvas, createImageData } = require("canvas");
global.ImageData = createImageData;
const size = WMF.image_size(data);
const canvas = createCanvas(size[0], size[1]);
WMF.draw_canvas(data, canvas);
Please consult the attached LICENSE file for details. All rights not explicitly granted by the Apache 2.0 License are reserved by the Original Author.
MS-WMF
: Windows Metafile FormatFAQs
Windows MetaFile (WMF) parser
The npm package wmf receives a total of 1,253,829 weekly downloads. As such, wmf popularity was classified as popular.
We found that wmf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
Security News
TC39 is meeting in Tokyo this week and they have approved nearly a dozen proposals to advance to the next stages.
Security News
Our threat research team breaks down two malicious npm packages designed to exploit developer trust, steal your data, and destroy data on your machine.