Skip to content

huzedong2015/file2canvas

Repository files navigation

file2canvas

npm GitHub file size in bytes GitHub package.json version

Image compression, correct image rotation angle.

Installing

$ npm install file2canvas

Usage

import file2canvas from "file2canvas";

file2canvas(file, options)
    .then((canvas) => {
        // code
    })
    .catch((errorType) => {
        // code
    });

Params

file

input choose file

options

Param Type Default require Description
maxSize Number 0 false file maxSize
width Number -- false output canvas width
background String transparent false canvas background

ErrorType

code des
100 File does not exist or format is wrong
101 The file size exceeds the specified size

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published