Initial commit

This commit is contained in:
Developer
2025-04-21 16:03:20 +02:00
commit 2832896157
22874 changed files with 3092801 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
'use strict';
const execBuffer = require('exec-buffer');
const gifsicle = require('gifsicle');
const isGif = require('is-gif');
module.exports = opts => buf => {
opts = Object.assign({}, opts);
if (!Buffer.isBuffer(buf)) {
return Promise.reject(new TypeError('Expected a buffer'));
}
if (!isGif(buf)) {
return Promise.resolve(buf);
}
const args = ['--no-warnings', '--no-app-extensions'];
if (opts.interlaced) {
args.push('--interlace');
}
if (opts.optimizationLevel) {
args.push(`--optimize=${opts.optimizationLevel}`);
}
if (opts.colors) {
args.push(`--colors=${opts.colors}`);
}
args.push('--output', execBuffer.output, execBuffer.input);
return execBuffer({
input: buf,
bin: gifsicle,
args
}).catch(err => {
err.message = err.stderr || err.message;
throw err;
});
};

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
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.

View File

@@ -0,0 +1,88 @@
{
"_from": "imagemin-gifsicle@^5.2.0",
"_id": "imagemin-gifsicle@5.2.0",
"_inBundle": false,
"_integrity": "sha512-K01m5QuPK+0en8oVhiOOAicF7KjrHlCZxS++mfLI2mV/Ksfq/Y9nCXCWDz6jRv13wwlqe5T7hXT+ji2DnLc2yQ==",
"_location": "/imagemin-gifsicle",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "imagemin-gifsicle@^5.2.0",
"name": "imagemin-gifsicle",
"escapedName": "imagemin-gifsicle",
"rawSpec": "^5.2.0",
"saveSpec": null,
"fetchSpec": "^5.2.0"
},
"_requiredBy": [
"/img-loader"
],
"_resolved": "https://registry.npmjs.org/imagemin-gifsicle/-/imagemin-gifsicle-5.2.0.tgz",
"_shasum": "3781524c457612ef04916af34241a2b42bfcb40a",
"_spec": "imagemin-gifsicle@^5.2.0",
"_where": "D:\\developments\\teaser-inertia\\nova-components\\NovaLeader\\node_modules\\img-loader",
"author": {
"name": "Kevin Mårtensson",
"email": "kevinmartensson@gmail.com",
"url": "github.com/kevva"
},
"bugs": {
"url": "https://github.com/imagemin/imagemin-gifsicle/issues"
},
"bundleDependencies": false,
"dependencies": {
"exec-buffer": "^3.0.0",
"gifsicle": "^3.0.0",
"is-gif": "^1.0.0"
},
"deprecated": false,
"description": "gifsicle imagemin plugin",
"devDependencies": {
"ava": "*",
"pify": "^2.3.0",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/imagemin/imagemin-gifsicle#readme",
"keywords": [
"compress",
"gif",
"gifsicle",
"gulpplugin",
"image",
"imageminplugin",
"img",
"minify",
"optimize"
],
"license": "MIT",
"maintainers": [
{
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
{
"name": "Shinnosuke Watanabe",
"url": "github.com/shinnn"
}
],
"name": "imagemin-gifsicle",
"repository": {
"type": "git",
"url": "git+https://github.com/imagemin/imagemin-gifsicle.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "5.2.0",
"xo": {
"esnext": true
}
}

View File

@@ -0,0 +1,68 @@
# imagemin-gifsicle [![Build Status](http://img.shields.io/travis/imagemin/imagemin-gifsicle.svg?style=flat)](https://travis-ci.org/imagemin/imagemin-gifsicle) [![Build status](https://ci.appveyor.com/api/projects/status/51vfu1ntxwx7t949?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/imagemin-gifsicle)
> gifsicle imagemin plugin
## Install
```
$ npm install --save imagemin-gifsicle
```
## Usage
```js
const imagemin = require('imagemin');
const imageminGifsicle = require('imagemin-gifsicle');
imagemin(['images/*.gif'], 'build/images', {use: [imageminGifsicle()]}).then(() => {
console.log('Images optimized');
});
```
## API
### imageminGifsicle([options])(buffer)
Returns a promise for a buffer.
#### options
##### interlaced
Type: `boolean`<br>
Default: `false`
Interlace gif for progressive rendering.
##### optimizationLevel
Type: `number`<br>
Default: `1`
Select an optimization level between `1` and `3`.
> The optimization level determines how much optimization is done; higher levels take longer, but may have better results.
1. Stores only the changed portion of each image.
2. Also uses transparency to shrink the file further.
3. Try several optimization methods (usually slower, sometimes better results)
##### colors
Type: `number`
Reduce the number of distinct colors in each output GIF to num or less. Num must be between 2 and 256.
#### buffer
Type: `buffer`
Buffer to optimize.
## License
MIT © [imagemin](https://github.com/imagemin)