1.0.0-alpha8 • Published 5 years ago

picture2canvas v1.0.0-alpha8

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

picture2canvas

npm GitHub file size in bytes GitHub package.json version

Later, I will try to write an EXIF JS that only gets the angle

Installing

$ npm install picture2canvas

Browser compatibility

The library should work fine on the following browsers (with Promise polyfill):

  • Google Chrome
  • IE10 +
  • Safari 8+

Usage

import picture2canvas from "picture2canvas";

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

Browser

<script src="dist/picture2canvas.js"></script>
<script>
    picture2canvas(file, options)
        .then((canvas) => {
            // code
        })
        .catch((errorType) => {
            // code
        });
</script>

Params

file

input choose file

options

ParamTypeDefaultrequireDescription
maxSizeNumber0falsefile maxSize
widthNumber--falseoutput canvas width
backgroundStringtransparentfalsecanvas background

ErrorType

codedes
100File does not exist or format is wrong
101The file size exceeds the specified size
1.0.0-alpha8

5 years ago

1.0.0-alpha7

5 years ago

1.0.0-alpha6

6 years ago

1.0.0-alpha5

6 years ago

1.0.0-alpha4

6 years ago

1.0.0-alpha3

6 years ago

1.0.0-alpha2

6 years ago

1.0.0-alpha1

6 years ago