1.0.0-alpha8 • Published 5 years ago
picture2canvas v1.0.0-alpha8
picture2canvas
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
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 |
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