This commit is contained in:
2021-11-21 11:18:28 +01:00
parent 7a358eb836
commit 230b10b2a3
9339 changed files with 892519 additions and 62 deletions

21
node_modules/jpegtran-bin/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
const path = require('path');
const BinWrapper = require('bin-wrapper');
const pkg = require('../package.json');
const url = `https://raw.githubusercontent.com/imagemin/jpegtran-bin/v${pkg.version}/vendor/`;
module.exports = new BinWrapper()
.src(`${url}macos/jpegtran`, 'darwin')
.src(`${url}linux/x86/jpegtran`, 'linux', 'x86')
.src(`${url}linux/x64/jpegtran`, 'linux', 'x64')
.src(`${url}freebsd/x86/jpegtran`, 'freebsd', 'x86')
.src(`${url}freebsd/x64/jpegtran`, 'freebsd', 'x64')
.src(`${url}sunos/x86/jpegtran`, 'sunos', 'x86')
.src(`${url}sunos/x64/jpegtran`, 'sunos', 'x64')
.src(`${url}win/x86/jpegtran.exe`, 'win32', 'x86')
.src(`${url}win/x64/jpegtran.exe`, 'win32', 'x64')
.src(`${url}win/x86/libjpeg-62.dll`, 'win32', 'x86')
.src(`${url}win/x64/libjpeg-62.dll`, 'win32', 'x64')
.dest(path.join(__dirname, '../vendor'))
.use(process.platform === 'win32' ? 'jpegtran.exe' : 'jpegtran');

37
node_modules/jpegtran-bin/lib/install.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
'use strict';
const path = require('path');
const binBuild = require('bin-build');
const log = require('logalot');
const bin = require('.');
const args = [
'-copy',
'none',
'-optimize',
'-outfile',
path.join(__dirname, '../test/fixtures/test-optimized.jpg'),
path.join(__dirname, '../test/fixtures/test.jpg')
];
bin.run(args).then(() => {
log.success('jpegtran pre-build test passed successfully');
}).catch(error => {
log.warn(error.message);
log.warn('jpegtran pre-build test failed');
log.info('compiling from source');
const cfg = [
'./configure --disable-shared',
`--prefix="${bin.dest()}" --bindir="${bin.dest()}"`
].join(' ');
binBuild.url('https://downloads.sourceforge.net/project/libjpeg-turbo/1.5.1/libjpeg-turbo-1.5.1.tar.gz', [
'touch configure.ac aclocal.m4 configure Makefile.am Makefile.in',
cfg,
'make install'
]).then(() => {
log.success('jpegtran built successfully');
}).catch(error => {
log.error(error.stack);
});
});