first commit
This commit is contained in:
21
build/node_modules/parse-png/index.js
generated
vendored
Normal file
21
build/node_modules/parse-png/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
const PNG = require('pngjs').PNG;
|
||||
|
||||
module.exports = (buf, opts) => {
|
||||
if (!Buffer.isBuffer(buf)) {
|
||||
return Promise.reject(new TypeError('Expected a buffer'));
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let png = new PNG(opts);
|
||||
|
||||
png.on('metadata', data => {
|
||||
png = Object.assign(png, data);
|
||||
});
|
||||
|
||||
png.on('error', reject);
|
||||
png.on('parsed', () => resolve(png));
|
||||
|
||||
png.end(buf);
|
||||
});
|
||||
};
|
||||
21
build/node_modules/parse-png/license
generated
vendored
Normal file
21
build/node_modules/parse-png/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Kevin Martensson <kevinmartensson@gmail.com> (github.com/kevva)
|
||||
|
||||
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.
|
||||
72
build/node_modules/parse-png/package.json
generated
vendored
Normal file
72
build/node_modules/parse-png/package.json
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"_from": "parse-png@^1.0.0",
|
||||
"_id": "parse-png@1.1.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-9cKtfHmTSQmGAgooTBmu5FlxH/I=",
|
||||
"_location": "/parse-png",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "parse-png@^1.0.0",
|
||||
"name": "parse-png",
|
||||
"escapedName": "parse-png",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/resize-img",
|
||||
"/to-ico"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/parse-png/-/parse-png-1.1.2.tgz",
|
||||
"_shasum": "f5c2ad7c7993490986020a284c19aee459711ff2",
|
||||
"_spec": "parse-png@^1.0.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build/node_modules/to-ico",
|
||||
"author": {
|
||||
"name": "Kevin Martensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "github.com/kevva"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kevva/parse-png/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"pngjs": "^3.2.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Parse a PNG",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"file-type": "^4.3.0",
|
||||
"get-stream": "^3.0.0",
|
||||
"pify": "^2.3.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/kevva/parse-png#readme",
|
||||
"keywords": [
|
||||
"parse",
|
||||
"png",
|
||||
"promise"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "parse-png",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kevva/parse-png.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.1.2",
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
||||
63
build/node_modules/parse-png/readme.md
generated
vendored
Normal file
63
build/node_modules/parse-png/readme.md
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
# parse-png [](https://travis-ci.org/kevva/parse-png)
|
||||
|
||||
> Parse a PNG
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save parse-png
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const parsePng = require('parse-png');
|
||||
|
||||
parsePng(fs.readFileSync('unicorn.png')).then(png => {
|
||||
console.log(png);
|
||||
/*
|
||||
{
|
||||
width: 200,
|
||||
height: 133,
|
||||
depth: 8,
|
||||
interlace: false,
|
||||
palette: false,
|
||||
color: true,
|
||||
alpha: false,
|
||||
bpp: 3,
|
||||
colorType: 2,
|
||||
data: <Buffer 29 48 4d ...>,
|
||||
}
|
||||
*/
|
||||
|
||||
png.adjustGamma();
|
||||
png.pack().pipe(fs.createWriteStream('unicorn-adjusted.png'));
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### parsePng(buffer, [options])
|
||||
|
||||
Returns a promise for a PNG instance. See the [pngjs documentation](https://github.com/lukeapage/pngjs#async-api) for more information.
|
||||
|
||||
#### buffer
|
||||
|
||||
Type: `buffer`
|
||||
|
||||
A PNG image buffer.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
See the [pngjs options](https://github.com/lukeapage/pngjs#options).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Kevin Martensson](http://github.com/kevva)
|
||||
Reference in New Issue
Block a user