Galerie und tage

This commit is contained in:
2021-11-23 17:56:26 +01:00
parent ff35366279
commit 5f873bee89
4693 changed files with 149659 additions and 301447 deletions

40
node_modules/is-png/readme.md generated vendored
View File

@@ -1,12 +1,14 @@
# is-png [![Build Status](https://travis-ci.org/sindresorhus/is-png.svg?branch=master)](https://travis-ci.org/sindresorhus/is-png)
> Check if a Buffer/Uint8Array is a [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) image
> 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
```
$ npm install is-png
```sh
$ npm install --save is-png
```
@@ -15,9 +17,9 @@ $ npm install is-png
##### Node.js
```js
const readChunk = require('read-chunk'); // npm install read-chunk
const isPng = require('is-png');
const buffer = readChunk.sync('unicorn.png', 0, 8);
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
@@ -26,13 +28,16 @@ isPng(buffer);
##### Browser
```js
(async () => {
const response = await fetch('unicorn.png');
const buffer = await response.arrayBuffer();
var xhr = new XMLHttpRequest();
xhr.open('GET', 'unicorn.png');
xhr.responseType = 'arraybuffer';
isPng(new Uint8Array(buffer));
xhr.onload = function () {
isPng(new Uint8Array(this.response));
//=> true
})();
};
xhr.send();
```
@@ -40,18 +45,11 @@ isPng(buffer);
### isPng(buffer)
Accepts a Buffer (Node.js) or Uint8Array. Returns a `boolean` of whether `buffer` is a PNG image.
Accepts a Buffer (Node.js) or Uint8Array.
#### buffer
The buffer to check. It only needs the first 8 bytes.
## Related
- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array/ArrayBuffer
It only needs the first 8 bytes.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
MIT © [Sindre Sorhus](http://sindresorhus.com)