# renomal-image

> 对图片进行方向矫正，以及限制最大尺寸（默认为 4000px）输出

Latest version **1.2.1** (published 2019-11-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install renomal-image
pnpm add renomal-image
yarn add renomal-image
bun add renomal-image
```

## 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 | 1.2.1 |
| Published | 2019-11-14 |
| First published | 2019-09-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yyued |

## Links

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

## Recent versions

- 1.2.1 (latest) — 2019-11-14
- 1.2.0 — 2019-10-30
- 1.1.2 — 2019-09-05
- 1.0.0 — 2019-09-05

## README

# renomal-image

对图片进行方向矫正，以及限制最大尺寸（默认为 4000px）输出

## 安装

```sh
$ npm i renomal-image

# 或者

$ yarn add renomal-image
```

## 使用

### File 格式

```html
<input type="file" onchange="chooseImage(event)" accept="image/*">
```

```js
import renomalImage from 'renomal-image'

async function chooseImage (event) {
  const file = event.target.files[0]
  // 可设置长宽上限最大值（默认为 4000）
  const { canvas, exifData } = await renomalImage(file, 4100)

  // 图片 exif 信息
  console.log(exifData)

  document.body.append(canvas)
}
```

### Base64 格式

```js
import renomalImage from 'renomal-image'

const base64 = 'xxxx'
const { canvas, exifData } = await renomalImage(base64, 4100)

console.log(exifData)
document.body.append(canvas)
```

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