0.0.1 • Published 6 years ago
react-form-upload-image-resize v0.0.1
ImageUploadResizer
This is react component for form input type file. Component goal is to resize uploaded image and convert it to jpeg format encoded as base64 for later uses.
Installation
This can also be installed with npm
.
Pending
Git clone
$ git clone git@bitbucket.org:dainiusgliebus/react-form-upload-image-resize.git
$ cd react-form-upload-image-resize
$ npm install
$ npm link
# in your project folder
$ npm link react-form-upload-image-resize
Usage
Use URLSearchParams
directly. You can instantiate a new instance of URLSearchParams
from a string or an object.
// import component into your react component
import ImageUploadResizer from 'react-form-upload-image-resize';
// put code where you want to have upload image input
<ImageUploadResizer change={callback} width={200} height={200} />
Props
Prop | Required | Value | Description |
---|---|---|---|
height | true | int | Resized image max height (default 200px) |
width | true | int | Resized image max width (default 200px) |
change | true | callback | Callback function to get processed uploaded image |
id | false | string | Input element id |
name | false | string | Input element name |
style | false | obj | Style object |
classes | false | string | CSS classes |
LICENSE
MIT license
0.0.1
6 years ago