# react-image-parser

> React image parser component

Latest version **2.0.2** (published 2018-11-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-image-parser
pnpm add react-image-parser
yarn add react-image-parser
bun add react-image-parser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2018-11-03 |
| First published | 2018-01-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vadim Fedorov |
| Maintainers | bhoodream |
| Keywords | react, data, images |

## Links

- npm: https://www.npmjs.com/package/react-image-parser
- Repository: https://github.com/bhoodream/react-image-parser
- Homepage: https://github.com/bhoodream/react-image-parser#readme
- Issues: https://github.com/bhoodream/react-image-parser/issues
- npm.io page: https://npm.io/package/react-image-parser

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2018-11-03
- 2.0.1 — 2018-11-03
- 2.0.0 — 2018-11-03
- 1.2.3 — 2018-10-31
- 1.2.2 — 2018-10-31
- 1.2.1 — 2018-10-29
- 1.2.0 — 2018-10-29
- 1.1.7 — 2018-07-06
- 1.1.6 — 2018-07-05
- 1.1.5 — 2018-07-05
- 1.1.4 — 2018-07-05
- 1.1.3 — 2018-07-04
- 1.1.2 — 2018-07-04
- 1.1.1 — 2018-07-04
- 1.1.0 — 2018-07-04
- … 14 more at https://npm.io/package/react-image-parser/versions

## README

# React-Image-Parser
With this component you can easily parse the image.  

#### Features:
- get image data;
- get image size.

#### Install:
```bash
npm i react-image-parser
```

#### Add:

```javascript
import ImageParser from 'react-image-parser';
```

#### Use:

```javascript
<ImageParser
    img={'./path/to/image'}
    maxImgSideSize={400}
    onImageParsed={data => console.log(data)}
/>
```

#### Props:

| Name        | Type           | Required  |  Default |  Description |
|:------------|:---------------|:----------|:---------|:-------------|
| img        | String | Yes  |  null |  Path to image. For example, './my/image/path.png' |
| maxImgSideSize | Number | No  |  bigger side of image | The maximum size of the sides of the canvas on which the image will be parsed. |
| onImageParsed | Function | No  |  null | The function in which the image parsing result will be passed. |

#### Result Structure:

```
{
    data: Uint8ClampedArray(64) [255, 202, 0, 134, 205, 159...], // image data
    size: { width: 100, height: 200 } // image size
} 
```

#### Demo:

For more information and examples check the [demo page](https://vadimfedorov.ru/lab/react-image-parser/).

---
_Source: https://npm.io/package/react-image-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
