Commit efced405 authored by Jerome Wu's avatar Jerome Wu

Add libwebp test

parent e065dda9
Subproject commit 4fe872bd290fb13ffbb808f3855018c745fcda1d
Subproject commit 39dfdf2129cffec578970eee38846d3e8c1652b2
const fs = require('fs');
const path = require('path');
const { TIMEOUT } = require('./config');
const { runFFmpeg } = require('./utils');
const IN_FILE_NAME = 'image.png';
const OUT_FILE_NAME = 'image.webp';
const FILE_SIZE = 6376;
let pngData = null;
beforeAll(() => {
pngData = Uint8Array.from(fs.readFileSync(path.join(__dirname, 'data', IN_FILE_NAME)));
});
test('transcode png to webp', async () => {
const args = ['-i', IN_FILE_NAME, OUT_FILE_NAME];
const { fileSize } = await runFFmpeg(IN_FILE_NAME, pngData, args, OUT_FILE_NAME);
expect(fileSize).toBe(FILE_SIZE);
}, TIMEOUT);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment