first commit
This commit is contained in:
9
build/node_modules/mozjpeg/cli.js
generated
vendored
Executable file
9
build/node_modules/mozjpeg/cli.js
generated
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
const spawn = require('child_process').spawn;
|
||||
const mozjpeg = require('.');
|
||||
|
||||
const input = process.argv.slice(2);
|
||||
|
||||
spawn(mozjpeg, input, {stdio: 'inherit'})
|
||||
.on('exit', process.exit);
|
||||
2
build/node_modules/mozjpeg/index.js
generated
vendored
Normal file
2
build/node_modules/mozjpeg/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
'use strict';
|
||||
module.exports = require('./lib').path();
|
||||
13
build/node_modules/mozjpeg/lib/index.js
generated
vendored
Normal file
13
build/node_modules/mozjpeg/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const BinWrapper = require('bin-wrapper');
|
||||
const pkg = require('../package.json');
|
||||
|
||||
const url = `https://raw.githubusercontent.com/imagemin/mozjpeg-bin/v${pkg.version}/vendor/`;
|
||||
|
||||
module.exports = new BinWrapper()
|
||||
.src(`${url}macos/cjpeg`, 'darwin')
|
||||
.src(`${url}linux/cjpeg`, 'linux')
|
||||
.src(`${url}win/cjpeg.exe`, 'win32')
|
||||
.dest(path.join(__dirname, '../vendor'))
|
||||
.use(process.platform === 'win32' ? 'cjpeg.exe' : 'cjpeg');
|
||||
43
build/node_modules/mozjpeg/lib/install.js
generated
vendored
Normal file
43
build/node_modules/mozjpeg/lib/install.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
const os = require('os');
|
||||
const BinBuild = require('bin-build');
|
||||
const log = require('logalot');
|
||||
const bin = require('.');
|
||||
|
||||
const cpuNum = os.cpus().length;
|
||||
|
||||
bin.run(['-version'], err => {
|
||||
if (err) {
|
||||
log.warn(err.message);
|
||||
log.warn('mozjpeg pre-build test failed');
|
||||
log.info('compiling from source');
|
||||
|
||||
let cfgExtras = '';
|
||||
if (process.platform === 'darwin') {
|
||||
cfgExtras = 'libpng_LIBS=\'/usr/local/lib/libpng16.a -lz\' --enable-static';
|
||||
}
|
||||
|
||||
const cfg = [
|
||||
`./configure --disable-shared --disable-dependency-tracking --with-jpeg8 ${cfgExtras}`,
|
||||
`--prefix="${bin.dest()}" --bindir="${bin.dest()}" --libdir="${bin.dest()}"`
|
||||
].join(' ');
|
||||
|
||||
const builder = new BinBuild()
|
||||
.src('https://github.com/mozilla/mozjpeg/releases/download/v3.2/mozjpeg-3.2-release-source.tar.gz')
|
||||
.cmd('autoreconf -fiv')
|
||||
.cmd(cfg)
|
||||
.cmd(`make -j${cpuNum}`)
|
||||
.cmd(`make install -j${cpuNum}`);
|
||||
|
||||
return builder.run(err => {
|
||||
if (err) {
|
||||
log.error(err.stack);
|
||||
return;
|
||||
}
|
||||
|
||||
log.success('mozjpeg built successfully');
|
||||
});
|
||||
}
|
||||
|
||||
log.success('mozjpeg pre-build test passed successfully');
|
||||
});
|
||||
9
build/node_modules/mozjpeg/license
generated
vendored
Normal file
9
build/node_modules/mozjpeg/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Imagemin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
100
build/node_modules/mozjpeg/package.json
generated
vendored
Normal file
100
build/node_modules/mozjpeg/package.json
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"mozjpeg@5.0.0",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "mozjpeg@5.0.0",
|
||||
"_id": "mozjpeg@5.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-uGccSSRWijY94AP/L9OXq4P3UsU=",
|
||||
"_location": "/mozjpeg",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "mozjpeg@5.0.0",
|
||||
"name": "mozjpeg",
|
||||
"escapedName": "mozjpeg",
|
||||
"rawSpec": "5.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "5.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/imagemin-mozjpeg"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/mozjpeg/-/mozjpeg-5.0.0.tgz",
|
||||
"_spec": "5.0.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "github.com/kevva"
|
||||
},
|
||||
"ava": {
|
||||
"serial": true
|
||||
},
|
||||
"bin": {
|
||||
"mozjpeg": "cli.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/imagemin/mozjpeg-bin/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"bin-build": "^2.2.0",
|
||||
"bin-wrapper": "^3.0.0",
|
||||
"logalot": "^2.0.0"
|
||||
},
|
||||
"description": "mozjpeg wrapper that makes it seamlessly available as a local dependency",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"bin-check": "^4.0.1",
|
||||
"compare-size": "^3.0.0",
|
||||
"execa": "^0.8.0",
|
||||
"tempy": "^0.2.1",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"cli.js",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/imagemin/mozjpeg-bin#readme",
|
||||
"keywords": [
|
||||
"imagemin",
|
||||
"jpeg",
|
||||
"jpg",
|
||||
"img",
|
||||
"image",
|
||||
"compress",
|
||||
"minify",
|
||||
"mozjpeg",
|
||||
"optimize"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Shinnosuke Watanabe",
|
||||
"url": "github.com/shinnn"
|
||||
}
|
||||
],
|
||||
"name": "mozjpeg",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/imagemin/mozjpeg-bin.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node lib/install.js",
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "5.0.0"
|
||||
}
|
||||
40
build/node_modules/mozjpeg/readme.md
generated
vendored
Normal file
40
build/node_modules/mozjpeg/readme.md
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# mozjpeg-bin [](http://travis-ci.org/imagemin/mozjpeg-bin)
|
||||
|
||||
> [mozjpeg](https://github.com/mozilla/mozjpeg) is a production-quality JPEG encoder that improves compression while maintaining compatibility with the vast majority of deployed decoders
|
||||
|
||||
You probably want [`imagemin-mozjpeg`](https://github.com/imagemin/imagemin-mozjpeg) instead.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install mozjpeg
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const {execFile} = require('child_process');
|
||||
const mozjpeg = require('mozjpeg');
|
||||
|
||||
execFile(mozjpeg, ['-outfile', 'output.jpg', 'input.jpg'], err => {
|
||||
console.log('Image minified!');
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
```
|
||||
$ npm install --global mozjpeg
|
||||
```
|
||||
|
||||
```
|
||||
$ mozjpeg --help
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Imagemin](https://github.com/imagemin)
|
||||
BIN
build/node_modules/mozjpeg/vendor/cjpeg
generated
vendored
Executable file
BIN
build/node_modules/mozjpeg/vendor/cjpeg
generated
vendored
Executable file
Binary file not shown.
Reference in New Issue
Block a user