first commit
This commit is contained in:
9
build/node_modules/jpegoptim-bin/cli.js
generated
vendored
Executable file
9
build/node_modules/jpegoptim-bin/cli.js
generated
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
const spawn = require('child_process').spawn;
|
||||
const jpegoptim = require('.');
|
||||
|
||||
const input = process.argv.slice(2);
|
||||
|
||||
spawn(jpegoptim, input, {stdio: 'inherit'})
|
||||
.on('exit', process.exit);
|
||||
2
build/node_modules/jpegoptim-bin/index.js
generated
vendored
Normal file
2
build/node_modules/jpegoptim-bin/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
'use strict';
|
||||
module.exports = require('./lib').path();
|
||||
13
build/node_modules/jpegoptim-bin/lib/index.js
generated
vendored
Normal file
13
build/node_modules/jpegoptim-bin/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/jpegoptim-bin/v${pkg.version}/vendor/`;
|
||||
|
||||
module.exports = new BinWrapper()
|
||||
.src(`${url}osx/jpegoptim`, 'darwin')
|
||||
.src(`${url}linux/jpegoptim`, 'linux')
|
||||
.src(`${url}win32/jpegoptim.exe`, 'win32')
|
||||
.dest(path.resolve(__dirname, '../vendor'))
|
||||
.use(process.platform === 'win32' ? 'jpegoptim.exe' : 'jpegoptim');
|
||||
28
build/node_modules/jpegoptim-bin/lib/install.js
generated
vendored
Normal file
28
build/node_modules/jpegoptim-bin/lib/install.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
const BinBuild = require('bin-build');
|
||||
const log = require('logalot');
|
||||
const bin = require('.');
|
||||
|
||||
bin.run(['--version'], err => {
|
||||
if (err) {
|
||||
log.warn(err.message);
|
||||
log.warn('jpegoptim pre-build test failed');
|
||||
log.info('compiling from source');
|
||||
|
||||
const builder = new BinBuild()
|
||||
.src('https://github.com/tjko/jpegoptim/archive/RELEASE.1.4.4.tar.gz')
|
||||
.cmd(`./configure --prefix="${bin.dest()}" --bindir="${bin.dest()}"`)
|
||||
.cmd('make install');
|
||||
|
||||
return builder.run(err => {
|
||||
if (err) {
|
||||
log.error(err.stack);
|
||||
return;
|
||||
}
|
||||
|
||||
log.success('jpegoptim built successfully');
|
||||
});
|
||||
}
|
||||
|
||||
log.success('jpegoptim pre-build test passed successfully');
|
||||
});
|
||||
9
build/node_modules/jpegoptim-bin/license
generated
vendored
Normal file
9
build/node_modules/jpegoptim-bin/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.
|
||||
102
build/node_modules/jpegoptim-bin/package.json
generated
vendored
Normal file
102
build/node_modules/jpegoptim-bin/package.json
generated
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"jpegoptim-bin@4.0.0",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "jpegoptim-bin@4.0.0",
|
||||
"_id": "jpegoptim-bin@4.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-ZIOakdjv2TXDdEGvyPc+9Acki7Y=",
|
||||
"_location": "/jpegoptim-bin",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "jpegoptim-bin@4.0.0",
|
||||
"name": "jpegoptim-bin",
|
||||
"escapedName": "jpegoptim-bin",
|
||||
"rawSpec": "4.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "4.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/imagemin-jpegoptim"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/jpegoptim-bin/-/jpegoptim-bin-4.0.0.tgz",
|
||||
"_spec": "4.0.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "1000ch",
|
||||
"email": "shogo.sensui@gmail.com",
|
||||
"url": "github.com/1000ch"
|
||||
},
|
||||
"bin": {
|
||||
"jpegoptim": "cli.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/imagemin/jpegoptim-bin/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"bin-build": "^2.2.0",
|
||||
"bin-wrapper": "^3.0.0",
|
||||
"logalot": "^2.0.0"
|
||||
},
|
||||
"description": "jpegoptim 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": [
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/imagemin/jpegoptim-bin#readme",
|
||||
"keywords": [
|
||||
"compress",
|
||||
"imagemin",
|
||||
"image",
|
||||
"img",
|
||||
"jpeg",
|
||||
"jpg",
|
||||
"minify",
|
||||
"optimize",
|
||||
"jpegoptim"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "github.com/kevva"
|
||||
},
|
||||
{
|
||||
"name": "Shinnosuke Watanabe",
|
||||
"url": "github.com/shinnn"
|
||||
}
|
||||
],
|
||||
"name": "jpegoptim-bin",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/imagemin/jpegoptim-bin.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node lib/install.js",
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "4.0.0"
|
||||
}
|
||||
52
build/node_modules/jpegoptim-bin/readme.md
generated
vendored
Normal file
52
build/node_modules/jpegoptim-bin/readme.md
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
# jpegoptim-bin [](http://travis-ci.org/imagemin/jpegoptim-bin)
|
||||
|
||||
> [jpegoptim](https://github.com/tjko/jpegoptim) is a utility for optimizing JPEG files that provides lossless optimization (based on optimizing the Huffman tables) and "lossy" optimization based on setting a maximum quality factor
|
||||
|
||||
You probably want [`imagemin-jpegoptim`](https://github.com/imagemin/imagemin-jpegoptim) instead.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install jpegoptim-bin
|
||||
```
|
||||
|
||||
Make sure you have the correct version of libjpeg. See [jpegoptim's README](https://github.com/tjko/jpegoptim#readme) for more information.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const {execFile} = require('child_process');
|
||||
const jpegoptim = require('jpegoptim-bin');
|
||||
|
||||
const args = [
|
||||
'--overwrite',
|
||||
'--strip-all',
|
||||
'--strip-iptc',
|
||||
'--strip-icc',
|
||||
'--all-progressive',
|
||||
'--dest=build',
|
||||
'input.jpg'
|
||||
];
|
||||
|
||||
execFile(jpegoptim, args, err => {
|
||||
console.log('Image minified');
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
```
|
||||
$ npm install --global jpegoptim-bin
|
||||
```
|
||||
|
||||
```
|
||||
$ jpegoptim --help
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Imagemin](https://github.com/imagemin)
|
||||
BIN
build/node_modules/jpegoptim-bin/vendor/jpegoptim
generated
vendored
Executable file
BIN
build/node_modules/jpegoptim-bin/vendor/jpegoptim
generated
vendored
Executable file
Binary file not shown.
186
build/node_modules/jpegoptim-bin/vendor/share/man/man1/jpegoptim.1
generated
vendored
Normal file
186
build/node_modules/jpegoptim-bin/vendor/share/man/man1/jpegoptim.1
generated
vendored
Normal file
@@ -0,0 +1,186 @@
|
||||
.TH JPEGOPTIM 1 "15 Aug 2016"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
jpegoptim \- utility to optimize/compress JPEG/JFIF files.
|
||||
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B jpegoptim
|
||||
[
|
||||
.B options
|
||||
] [
|
||||
.B filenames
|
||||
]
|
||||
|
||||
.SH DESCRIPTION
|
||||
.I jpegoptim
|
||||
is used to optimize/compress jpeg files. Program supports lossless
|
||||
optimization, which is based on optimizing the Huffman tables. And
|
||||
so called "lossy" optimization where in addition to optimizing Huffman
|
||||
tables user can specify upperlimit for image quality.
|
||||
|
||||
NOTE! By default jpegoptim modifies the input files (if they are optimized),
|
||||
to preserve original files use option \fB\-d\fR to specify alternate directory for saving the optimized files to.
|
||||
|
||||
Only normal files are optimized (symbolic links and special files are skipped).
|
||||
Also, any other hard links to the file being optimized (as created using
|
||||
.BR link (2))
|
||||
are unaffected.
|
||||
|
||||
|
||||
.SH OPTIONS
|
||||
.PP
|
||||
Options may be either the traditional POSIX one letter options, or the
|
||||
GNU style long options. POSIX style options start with a single
|
||||
``\-'', while GNU long options start with ``\-\^\-''.
|
||||
|
||||
Options offered by
|
||||
.I jpegoptim
|
||||
are the following:
|
||||
.TP 0.6i
|
||||
.B -d<path>, --dest=<path>
|
||||
Sets alternative destination directory where to save optimized files
|
||||
(default is to overwrite the originals). Please note that unchanged files
|
||||
won't be added to the destination directory. This means if the source
|
||||
file can't be compressed, no file will be created in the destination path.
|
||||
.TP 0.6i
|
||||
.B -f, --force
|
||||
Force optimization, even if the result would be larger than the original
|
||||
file.
|
||||
.TP 0.6i
|
||||
.B -h, --help
|
||||
Displays short usage information and exits.
|
||||
.TP 0.6i
|
||||
.B -m<quality>, --max=<quality>
|
||||
Sets the maximum image quality factor (disables lossless optimization
|
||||
mode, which is by default enabled). This option will reduce quality
|
||||
of those source files that were saved using higher quality setting.
|
||||
While files
|
||||
that already have lower quality setting will be compressed using the
|
||||
lossless optimization method.
|
||||
|
||||
Valid values for quality parameter are: 0 - 100
|
||||
.TP 0.6i
|
||||
.B -n, --noaction
|
||||
Don't really optimize files, just print results.
|
||||
.TP 0.6i
|
||||
.B -S<size>, --size=<size>
|
||||
Try to optimize file to given size (disables lossless
|
||||
optimization mode). Target size is specified either in
|
||||
kilobytes (1 - n) or as percentage (1% - 99%) of the original file size.
|
||||
.TP 0.6i
|
||||
.B -T<threshold>, --threshold=<threshold>
|
||||
Keep the file unchanged if the compression gain is lower than the threshold (%).
|
||||
|
||||
Valid values for threshold are: 0 - 100
|
||||
.TP 0.6i
|
||||
.B -b, --csv
|
||||
Print progress info in CSV format.
|
||||
.TP 0.6i
|
||||
.B -o, --overwrite
|
||||
Overwrite target file even if it exists (when using -d option).
|
||||
.TP 0.6i
|
||||
.B -p, --preserve
|
||||
Preserve file modification times.
|
||||
.TP 0.6i
|
||||
.B -P, --preserve-perms
|
||||
Preserve file permissions (owner/group) by overwriting the original file. This is
|
||||
slightly less safe than the default mode of operation (where new file is first saved
|
||||
as temporary file and then renamed over the original file).
|
||||
In this mode a backup of the original file is made with .jpegoptim.bak extension,
|
||||
and this file is removed after the original file has been successfully replaced.
|
||||
NOTE! if running jpegoptim as root there is generally no need to use this option,
|
||||
as jpegoptim is able to preserve file permissions when run by root in default mode.
|
||||
.TP 0.6i
|
||||
.B -q, --quiet
|
||||
Quiet mode.
|
||||
.TP 0.6i
|
||||
.B -t, --totals
|
||||
Print totals after processing all files.
|
||||
.TP 0.6i
|
||||
.B -v, --verbose
|
||||
Enables verbose mode (positively chatty).
|
||||
|
||||
.TP 0.6i
|
||||
.B --all-normal
|
||||
Force all output files to be non-progressive. Can be used to convert
|
||||
all input files to progressive JPEGs when used with --force option.
|
||||
.TP 0.6i
|
||||
.B --all-progressive
|
||||
Force all output files to be progressive. Can be used to convert
|
||||
all normal (non-progressive) JPEGs input files to progressive when used with --force option.
|
||||
|
||||
.TP 0.6i
|
||||
.B -s, --strip-all
|
||||
Strip all markers from output file. (NOTE! by default
|
||||
only Comment & Exif/IPTC/PhotoShop/ICC/XMP markers are kept, everything else is discarded).
|
||||
Output JPEG still likely will contains one or two markers (JFIF and Adobe APP14) depending
|
||||
on colorspace used in the image, as these markers are generated by the libjpeg encoder
|
||||
automatically.
|
||||
.TP 0.6i
|
||||
.B --strip-none
|
||||
Preserve "all" markers in the image. This will leave all markers untouched in the image,
|
||||
except JFIF (APP0) and Adobe (APP14) markers as those get regenerated by the libjpeg library.
|
||||
.TP 0.6i
|
||||
.B --strip-com
|
||||
Strip Comment (COM) markers from output file.
|
||||
.TP 0.6i
|
||||
.B --strip-exif
|
||||
Strip EXIF markers from output file.
|
||||
.TP 0.6i
|
||||
.B --strip-iptc
|
||||
Strip IPTC / Adobe Photoshop (APP13) markers from output file.
|
||||
.TP 0.6i
|
||||
.B --strip-icc
|
||||
Strip ICC profiles from output file.
|
||||
.TP 0.6i
|
||||
.B --strip-xmp
|
||||
Strip XMP profiles from output file.
|
||||
|
||||
|
||||
.TP 0.6i
|
||||
.B --stdout
|
||||
Send output image to standard output. Note, if optimization didn't create smaller file
|
||||
than the input file, then no output (image) is sent to standard output. (Option
|
||||
.B -f
|
||||
can be used to force output of image always, even if optimized image was not smaller than input).
|
||||
|
||||
.TP 0.6i
|
||||
.B --stdin
|
||||
Read input image from standard input. When this option is used then only one
|
||||
image is read from standard output. Any (other) input files specified on command
|
||||
line are ignored.
|
||||
Note, if input file '-' is seen on command line then standard input is also assumed.
|
||||
|
||||
Currently this option will explicitly enable
|
||||
.B -f
|
||||
option, thus output image is always sent to standard output (even if no optimization was possible).
|
||||
|
||||
|
||||
|
||||
.SH BUGS
|
||||
When using --size option, resulting file is not always exactly the
|
||||
requested size. Workaround is to re-run jpegoptim on the same file again
|
||||
which often will result file closer to target size.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
jpeginfo(1)
|
||||
|
||||
.SH AUTHOR
|
||||
Timo Kokkonen <tjko@iki.fi>
|
||||
|
||||
.SH COPYING
|
||||
Copyright (C) 1996-2016 Timo Kokkonen
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
Reference in New Issue
Block a user