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,10 @@
'use strict';
module.exports = function (buf) {
if (!buf || buf.length < 3) {
return false;
}
return buf[0] === 71 &&
buf[1] === 73 &&
buf[2] === 70;
};

View File

@@ -0,0 +1,74 @@
{
"_from": "is-gif@^1.0.0",
"_id": "is-gif@1.0.0",
"_inBundle": false,
"_integrity": "sha1-ptKumIkwB7/6l6HYwB1jIFgyCX4=",
"_location": "/is-gif",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "is-gif@^1.0.0",
"name": "is-gif",
"escapedName": "is-gif",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/imagemin-gifsicle"
],
"_resolved": "https://registry.npmjs.org/is-gif/-/is-gif-1.0.0.tgz",
"_shasum": "a6d2ae98893007bffa97a1d8c01d63205832097e",
"_spec": "is-gif@^1.0.0",
"_where": "D:\\developments\\teaser-inertia\\nova-components\\NovaLeader\\node_modules\\imagemin-gifsicle",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/is-gif/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Check if a Buffer/Uint8Array is a GIF image",
"devDependencies": {
"mocha": "*",
"read-chunk": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/is-gif#readme",
"keywords": [
"gif",
"graphics",
"image",
"img",
"pic",
"picture",
"photo",
"type",
"detect",
"check",
"is",
"exif",
"binary",
"buffer",
"uint8array"
],
"license": "MIT",
"name": "is-gif",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/is-gif.git"
},
"scripts": {
"test": "mocha"
},
"version": "1.0.0"
}

View File

@@ -0,0 +1,55 @@
# is-gif [![Build Status](https://travis-ci.org/sindresorhus/is-gif.svg?branch=master)](https://travis-ci.org/sindresorhus/is-gif)
> Check if a Buffer/Uint8Array is a [GIF](http://en.wikipedia.org/wiki/Graphics_Interchange_Format) image
Used by [image-type](https://github.com/sindresorhus/image-type).
## Install
```sh
$ npm install --save is-gif
```
## Usage
##### Node.js
```js
var readChunk = require('read-chunk'); // npm install read-chunk
var isGif = require('is-gif');
var buffer = readChunk.sync('unicorn.gif', 0, 3);
isGif(buffer);
//=> true
```
##### Browser
```js
var xhr = new XMLHttpRequest();
xhr.open('GET', 'unicorn.gif');
xhr.responseType = 'arraybuffer';
xhr.onload = function () {
isGif(new Uint8Array(this.response));
//=> true
};
xhr.send();
```
## API
### isGif(buffer)
Accepts a Buffer (Node.js) or Uint8Array.
It only needs the first 3 bytes.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)