first commit
This commit is contained in:
15
build/node_modules/is-png/index.js
generated
vendored
Normal file
15
build/node_modules/is-png/index.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
module.exports = function (buf) {
|
||||
if (!buf || buf.length < 8) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return buf[0] === 137 &&
|
||||
buf[1] === 80 &&
|
||||
buf[2] === 78 &&
|
||||
buf[3] === 71 &&
|
||||
buf[4] === 13 &&
|
||||
buf[5] === 10 &&
|
||||
buf[6] === 26 &&
|
||||
buf[7] === 10;
|
||||
};
|
||||
21
build/node_modules/is-png/license
generated
vendored
Normal file
21
build/node_modules/is-png/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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.
|
||||
83
build/node_modules/is-png/package.json
generated
vendored
Normal file
83
build/node_modules/is-png/package.json
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"_from": "is-png@^1.0.0",
|
||||
"_id": "is-png@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-1XSxK/J1wDUEVVcLDltXqwYgd84=",
|
||||
"_location": "/is-png",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "is-png@^1.0.0",
|
||||
"name": "is-png",
|
||||
"escapedName": "is-png",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/imagemin-advpng",
|
||||
"/imagemin-guetzli",
|
||||
"/imagemin-optipng",
|
||||
"/imagemin-pngcrush",
|
||||
"/imagemin-pngout",
|
||||
"/imagemin-pngquant",
|
||||
"/imagemin-upng",
|
||||
"/imagemin-zopfli"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/is-png/-/is-png-1.1.0.tgz",
|
||||
"_shasum": "d574b12bf275c0350455570b0e5b57ab062077ce",
|
||||
"_spec": "is-png@^1.0.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build/node_modules/imagemin-advpng",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/is-png/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Check if a Buffer/Uint8Array is a PNG image",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"read-chunk": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/is-png#readme",
|
||||
"keywords": [
|
||||
"png",
|
||||
"portable",
|
||||
"network",
|
||||
"graphics",
|
||||
"image",
|
||||
"img",
|
||||
"pic",
|
||||
"picture",
|
||||
"photo",
|
||||
"type",
|
||||
"detect",
|
||||
"check",
|
||||
"is",
|
||||
"exif",
|
||||
"binary",
|
||||
"buffer",
|
||||
"uint8array"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "is-png",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/is-png.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
||||
55
build/node_modules/is-png/readme.md
generated
vendored
Normal file
55
build/node_modules/is-png/readme.md
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
# is-png [](https://travis-ci.org/sindresorhus/is-png)
|
||||
|
||||
> Check if a Buffer/Uint8Array is a [PNG](http://en.wikipedia.org/wiki/Portable_Network_Graphics) image
|
||||
|
||||
Used by [image-type](https://github.com/sindresorhus/image-type).
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save is-png
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
##### Node.js
|
||||
|
||||
```js
|
||||
var readChunk = require('read-chunk'); // npm install read-chunk
|
||||
var isPng = require('is-png');
|
||||
var buffer = readChunk.sync('unicorn.png', 0, 8);
|
||||
|
||||
isPng(buffer);
|
||||
//=> true
|
||||
```
|
||||
|
||||
##### Browser
|
||||
|
||||
```js
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', 'unicorn.png');
|
||||
xhr.responseType = 'arraybuffer';
|
||||
|
||||
xhr.onload = function () {
|
||||
isPng(new Uint8Array(this.response));
|
||||
//=> true
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### isPng(buffer)
|
||||
|
||||
Accepts a Buffer (Node.js) or Uint8Array.
|
||||
|
||||
It only needs the first 8 bytes.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
Reference in New Issue
Block a user