Error: the string "Header: Type 52695 must be 1 or 2" was thrown, throw an Error :) #2

Open
opened 2021-06-23 04:18:30 +00:00 by hydra1983 · 0 comments
hydra1983 commented 2021-06-23 04:18:30 +00:00 (Migrated from github.com)

The sample file: BIRD.WMF.zip

The sample code:

var jsEnv = require("browser-or-node");
var canvas = require("canvas");
// eslint-disable-next-line no-undef
global.ImageData = canvas.createImageData;

var data = fs.readFileSync(path.join(__dirname, 'test-data', 'BIRD.WMF'));
var WMF;
if (jsEnv.isNode) {
    WMF = require('wmf/dist/wmf.node');
} else {
    WMF = require('wmf/dist/wmf');
}
console.log(typeof data);
var size = WMF.image_size(data);
console.log(size);
The sample file: [BIRD.WMF.zip](https://github.com/SheetJS/js-wmf/files/6698859/BIRD.WMF.zip) The sample code: ```js var jsEnv = require("browser-or-node"); var canvas = require("canvas"); // eslint-disable-next-line no-undef global.ImageData = canvas.createImageData; var data = fs.readFileSync(path.join(__dirname, 'test-data', 'BIRD.WMF')); var WMF; if (jsEnv.isNode) { WMF = require('wmf/dist/wmf.node'); } else { WMF = require('wmf/dist/wmf'); } console.log(typeof data); var size = WMF.image_size(data); console.log(size); ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/js-wmf#2
No description provided.